NPM(1)

πŸ“¦ version 22.23.4, in opensuse-leap 16.0

πŸ’… NAME πŸ’…

npm β€” the javascript package manager, bestie. like, THE package manager. no cap.

🌸 Synopsis 🌸

npm
⚠️ heads up queen: this command is unaware of workspaces. like it genuinely does not know they exist. periodt.

πŸŽ€ Version πŸŽ€

10.9.9 β€” yes that's the one we're on rn πŸ’–


✨ DESCRIPTION ✨

okay so npm is literally the package manager for the Node JavaScript platform. it puts modules in place so that node can actually find them, and it manages dependency conflicts intelligently β€” like it's genuinely so smart about it, main character energy fr.

it's extremely configurable to support a whole variety of use cases. most commonly you use it to publish, discover, install, and develop node programs. that's the whole vibe.

run npm help to get a list of available commands 🫢


πŸ”₯ IMPORTANT πŸ”₯

npm comes preconfigured to use npm's public registry at https://registry.npmjs.org by default. use of the npm public registry is subject to terms of use available at https://docs.npmjs.com/policies/terms β€” read them babes, it's giving responsible.

you can configure npm to use any compatible registry you like, and you can even run your own registry. but if you're using someone else's registry, that's governed by their terms of use. not ours. iykyk πŸ’…


πŸ¦‹ INTRODUCTION πŸ¦‹

you probably got npm because you want to install stuff. that's it. that's the reason. iconic.

the very first thing you will most likely want to run in any node program is npm install to install its dependencies.

you can also run npm install blerg to install the latest version of "blerg". check out npm help install for more info β€” it can do a LOT of stuff, like genuinely a lot.

use the npm search command to show everything that's available in the public registry. use npm ls to show everything you've installed. slay, now you know what you have 🌈


🧚 DEPENDENCIES 🧚

if a package lists a dependency using a git URL, npm will install that dependency using the git command (⟨https://github.com/git-guides/install-git⟩) and will generate an error if it is not installed. so like, have git. just have it.

if one of the packages npm tries to install is a native node module and requires compiling of C++ Code, npm will use node-gyp (⟨https://github.com/nodejs/node-gyp⟩) for that task.

  • on a Unix system, node-gyp needs Python, make and a buildchain like GCC.
  • on Windows, Python and Microsoft Visual Studio C++ are needed.

for more information visit the node-gyp repository (⟨https://github.com/nodejs/node-gyp⟩) and the node-gyp Wiki (⟨https://github.com/nodejs/node-gyp/wiki⟩). good luck soldier 😭


πŸ’œ DIRECTORIES πŸ’œ

see npm help folders to learn about where npm puts stuff.

in particular, npm has two modes of operation:

  • local mode: npm installs packages into the current project directory, which defaults to the current working directory. packages install to ./node_modules, and bins to ./node_modules/.bin.
  • global mode: npm installs packages into the install prefix at $npm_config_prefix/lib/node_modules and bins to $npm_config_prefix/bin.

local mode is the default. use -g or --global on any command to run in global mode instead. that's the whole switch. that's it. πŸ’…


πŸ‘‘ DEVELOPER USAGE πŸ‘‘

if you're using npm to develop and publish your code, check out the following help topics:

  • json: make a package.json file. see package.json ⟨/configuring-npm/package-json⟩.
  • link: links your current working code into Node's path, so that you don't have to reinstall every time you make a change. use npm help link to do this. genuinely a lifesaver 🫢
  • install: it's a good idea to install things if you don't need the symbolic link. especially, installing other peoples code from the registry is done via npm help install.
  • adduser: create an account or log in. when you do this, npm will store credentials in the user config file. (yes, keep that file safe πŸ₯Ί)
  • publish: use the npm help publish command to upload your code to the registry. drop it, queen πŸ‘‘

⭐ CONFIGURATION ⭐

npm is extremely configurable. it reads its configuration options from 5 places.

  1. Command line switches: set a config with --key val. all keys take a value, even if they are booleans (the config parser doesn't know what the options are at the time of parsing). if you do not provide a value (--key) then the option is set to boolean true.
  2. Environment Variables: set any config by prefixing the name in an environment variable with npm_config_. for example, export npm_config_key=val.
  3. User Configs: the file at $HOME/.npmrc is an ini-formatted list of configs. if present, it is parsed. if the userconfig option is set in the cli or env, that file will be used instead.
  4. Global Configs: the file found at ./etc/npmrc (relative to the global prefix) will be parsed if it is found. see npm help prefix for more info on the global prefix. if the globalconfig option is set in the cli, env, or user config, then that file is parsed instead.
  5. Defaults: npm's default configuration options are defined in lib/utils/config/definitions.js. these must not be changed. like do not touch them. do not. πŸ™ˆ

see npm help config for much much more information. like much much.


🌸 CONTRIBUTIONS 🌸

patches welcome! 🫢

if you would like to help, but don't know what to work on, read the contributing guidelines ⟨https://github.com/npm/cli/blob/latest/CONTRIBUTING.md⟩ and check the issues list. there's literally something for everyone bestie.


πŸ’€ BUGS πŸ’€

when you find issues, please report them: ⟨https://github.com/npm/cli/issues⟩

please be sure to follow the template and bug reporting guidelines. like actually follow them, the template exists for a reason 😭


πŸ“ FEATURE REQUESTS πŸ“

discuss new feature ideas on our discussion forum:

or suggest formal RFC proposals:

big brain ideas go here 🧠✨


🌈 SEE ALSO 🌈

  • npm help help
  • package.json ⟨/configuring-npm/package-json⟩
  • npm help npmrc
  • npm help config
  • npm help install
  • npm help prefix
  • npm help publish

okay that's the whole page, go forth and install things πŸ’– signing off β€” NPM@10.9.9, dated July 2026. love u, bye! πŸ‘‹πŸŽ€

πŸ“¦ where this page comes from