79429776

Date: 2025-02-11 11:21:05
Score: 0.5
Natty:
Report link

According to oficial documentation https://docs.npmjs.com/cli/v7/commands/npm-publish you could use the access param as follows

npm publish --access=restricted

If you do not want your scoped package to be publicly viewable (and installable) set --access=restricted.

Unscoped packages can not be set to restricted meaning you have to add the @scope prefix to your package i.e.: @foo/yeoman-generator-wherever.

If you want to publish the package to make it publicly accesible you can set the flag --access=public.

npm publish --access=public

My advise is to check the npm version and the documentation as maybe the default behaviour for npm publish differs so better to be explicit and set the flag of what you need.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @scope
  • Low reputation (0.5):
Posted by: pdr0