dependabot/npm_and_yarn/main/eslint-10.4.0
@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: npm-set |
| 3 | section: 1 |
| 4 | description: Set a value in the npm configuration |
| 5 | github_repo: npm/cli |
| 6 | github_branch: latest |
| 7 | github_path: docs/lib/content/commands/npm-set.md |
| 8 | redirect_from: |
| 9 | - /cli-commands/npm-set |
| 10 | - /cli-commands/set |
| 11 | - /cli-documentation/cli-commands/npm-set |
| 12 | - /cli-documentation/cli-commands/set |
| 13 | - /cli-documentation/commands/npm-set |
| 14 | - /cli-documentation/commands/set |
| 15 | - /cli-documentation/npm-set |
| 16 | - /cli-documentation/set |
| 17 | - /cli-documentation/v11/cli-commands/npm-set |
| 18 | - /cli-documentation/v11/cli-commands/set |
| 19 | - /cli-documentation/v11/commands/npm-set |
| 20 | - /cli-documentation/v11/commands/set |
| 21 | - /cli-documentation/v11/npm-set |
| 22 | - /cli-documentation/v11/set |
| 23 | - /cli/cli-commands/npm-set |
| 24 | - /cli/cli-commands/set |
| 25 | - /cli/commands/npm-set |
| 26 | - /cli/commands/set |
| 27 | - /cli/npm-set |
| 28 | - /cli/set |
| 29 | - /cli/v11/cli-commands/npm-set |
| 30 | - /cli/v11/cli-commands/set |
| 31 | - /cli/v11/commands/set |
| 32 | - /cli/v11/npm-set |
| 33 | - /cli/v11/set |
| 34 | - /commands/npm-set |
| 35 | - /commands/set |
| 36 | --- |
| 37 | |
| 38 | ### Synopsis |
| 39 | |
| 40 | ```bash |
| 41 | npm set <key>=<value> [<key>=<value> ...] (See `npm config`) |
| 42 | ``` |
| 43 | |
| 44 | Note: This command is unaware of workspaces. |
| 45 | |
| 46 | ### Description |
| 47 | |
| 48 | Set a value in the npm configuration |
| 49 | |
| 50 | ### Configuration |
| 51 | |
| 52 | #### `global` |
| 53 | |
| 54 | - Default: false |
| 55 | - Type: Boolean |
| 56 | |
| 57 | Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See [folders](/cli/v11/configuring-npm/folders) for more on the differences in behavior. |
| 58 | |
| 59 | - packages are installed into the `{prefix}/lib/node_modules` folder, instead of the current working directory. |
| 60 | - bin files are linked to `{prefix}/bin` |
| 61 | - man pages are linked to `{prefix}/share/man` |
| 62 | |
| 63 | #### `location` |
| 64 | |
| 65 | - Default: "user" unless `--global` is passed, which will also set this value to "global" |
| 66 | - Type: "global", "user", or "project" |
| 67 | |
| 68 | When passed to `npm config` this refers to which config file to use. |
| 69 | |
| 70 | When set to "global" mode, packages are installed into the `prefix` folder instead of the current working directory. See [folders](/cli/v11/configuring-npm/folders) for more on the differences in behavior. |
| 71 | |
| 72 | - packages are installed into the `{prefix}/lib/node_modules` folder, instead of the current working directory. |
| 73 | - bin files are linked to `{prefix}/bin` |
| 74 | - man pages are linked to `{prefix}/share/man` |
| 75 | |
| 76 | ### See Also |
| 77 | |
| 78 | - [npm help config](/cli/v11/commands/npm-config) |