As an Org member, you can configure your npm client to:
Before configuring your npm client, you must install npm.
If you will be publishing packages with your Org’s scope often, you can add your Org’s scope to your global .npmrc
configuration file.
Note: Setting the Org scope using the steps below will only set the scope for new packages; for existing packages, you will need to update the name
field in package.json
.
npm config set scope <org-name> --global
For packages you do not want to publish with your Org’s scope, you must manually edit the package’s package.json
to remove the Org scope from the name
field.
cd /path/to/package
npm config set scope <org-name>
By default, publishing a scoped package with npm publish
will publish the package as private. If you are a member of an Org on the free Org plan, or are on the paid Org plan but want to publish a scoped package as public, you must pass the --access public
flag:
npm publish --access public
.
You can set a single package to pass --access public
to every npm publish
command that you issue for that package.
cd /path/to/package
npm config set access public
You can set all packages to pass --access public
to every npm publish
command that you issue for that package.
Warning: Setting packages access to public
in your global .npmrc
will affect all packages you create,
including packages in your personal account scope, as well as packages scoped to your Org.
npm config set access public --global