jpg619/version-bump-tar-2
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 1 | --- |
| 2 | title: Configuring your npm client with your organization settings |
| 3 | redirect_from: |
| 4 | - /configuring-your-npm-client-with-your-org-settings |
| 5 | --- |
| 6 | |
| 7 | As an organization member, you can configure your npm client to: |
| 8 | |
| 9 | - make a single package or all new packages you create locally use your organization's scope |
| 10 | - make a single package or all new packages you create locally have default public visibility |
| 11 | |
| 12 | Before configuring your npm client, you must [install npm][install-npm]. |
| 13 | |
| 14 | ## Configuring your npm client to use your organization's scope |
| 15 | |
| 16 | If you will be publishing packages with your organization's scope often, you can add your organization's scope to your global `.npmrc` configuration file. |
| 17 | |
| 18 | ### Setting your organization scope for all new packages |
| 19 | |
| 20 | <Note> |
| 21 | |
| 22 | **Note:** Setting the organization 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`. |
| 23 | |
| 24 | </Note> |
| 25 | |
| 26 | On the command line, run the following command, replacing <org-name> with the name of your organization: |
| 27 | |
| 28 | ``` |
| 29 | npm config set scope <org-name> --global |
| 30 | ``` |
| 31 | |
| 32 | For packages you do not want to publish with your organization's scope, you must manually edit the package's `package.json` to remove the organization scope from the `name` field. |
| 33 | |
| 34 | ### Setting your organization scope for a single package |
| 35 | |
| 36 | 1. On the command line, navigate to the package directory. |
| 37 | |
| 38 | ``` |
| 39 | cd /path/to/package |
| 40 | ``` |
| 41 | |
| 42 | 2. Run the following command, replacing <org-name> with the name of your organization: |
| 43 | |
| 44 | ``` |
| 45 | npm config set scope <org-name> |
| 46 | ``` |
| 47 | |
| 48 | ## Changing default package visibility to public |
| 49 | |
| 50 | By default, publishing a scoped package with `npm publish` will publish the package as private. If you are a member of an organization on the free organization plan, or are on the paid organization plan but want to publish a scoped package as public, you must pass the `--access public` flag: |
| 51 | |
| 52 | ``` |
| 53 | npm publish --access public |
| 54 | ``` |
| 55 | |
| 56 | ### Setting package visibility to public for a single package |
| 57 | |
| 58 | You can set a single package to pass `--access public ` to every `npm publish` command that you issue for that package. |
| 59 | |
| 60 | 1. On the command line, navigate to the package directory. |
| 61 | |
| 62 | ``` |
| 63 | cd /path/to/package |
| 64 | |
| 65 | ``` |
| 66 | |
| 67 | 2. Run the following command: |
| 68 | |
| 69 | ``` |
| 70 | npm config set access public |
| 71 | ``` |
| 72 | |
| 73 | ### Setting package visibility to public for all packages |
| 74 | |
| 75 | You can set all packages to pass `--access public ` to every `npm publish` command that you issue for that package. |
| 76 | |
| 77 | <Note> |
| 78 | |
| 79 | **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 organization. |
| 80 | |
| 81 | </Note> |
| 82 | |
| 83 | On the command line, run the following command: |
| 84 | |
| 85 | ``` |
| 86 | npm config set access public --global |
| 87 | ``` |
| 88 | |
| 89 | [install-npm]: downloading-and-installing-node-js-and-npm |