Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Publishing with --access restricted should prevent packages with no namespace being pushed #2588

Closed
strongoose opened this issue Feb 1, 2021 · 1 comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@strongoose
Copy link

Current Behavior:

If a non-namespaced package is published with
npm publish --access restricted

npm ignored the user directive that access should be restricted and publishes the package.

Expected Behavior:

Attempting to publish a package which isn't namespaced with npm publish --access restricted should

  1. warn the user that packages without namespaces cannot be given restricted access
  2. exit with an error

Steps To Reproduce:

  1. Create a non-namespaces NPM package
  2. Publish is using npm publish --access restricted
@strongoose strongoose added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Feb 1, 2021
@strongoose strongoose changed the title [BUG] --access restricted should prevent packages with no namespace being pushed [BUG] Publishing with --access restricted should prevent packages with no namespace being pushed Feb 1, 2021
@wraithgar
Copy link
Member

Can't duplicate this in npm v7.

~/D/n/foo $ npm publish --access restricted
npm notice 
npm notice 📦  foo@1.0.0
npm notice === Tarball Contents === 
npm notice 246B package.json
npm notice === Tarball Details === 
npm notice name:          foo                                     
npm notice version:       1.0.0                                   
npm notice filename:      foo-1.0.0.tgz                           
npm notice package size:  274 B                                   
npm notice unpacked size: 246 B                                   
npm notice shasum:        a1dd3e02b8f5d099099917dbdd0fd1a9418b79ef
npm notice integrity:     sha512-RRAjfWmDa3FX8[...]RLi+i/hCsWkJA==
npm notice total files:   1                                       
npm notice 
npm ERR! code EUNSCOPED
npm ERR! Can't restrict access to unscoped packages.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wraithgar/.npm/_logs/2021-02-02T19_40_41_001Z-debug.log
~/D/n/foo $ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants