NPM(1)
π 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-gypneeds 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_modulesand 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.jsonfile. 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 linkto 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 publishcommand to upload your code to the registry. drop it, queen π
β CONFIGURATION β
npm is extremely configurable. it reads its configuration options from 5 places.
- 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 booleantrue. - Environment Variables: set any config by prefixing the name in an environment variable with
npm_config_. for example,export npm_config_key=val. - User Configs: the file at
$HOME/.npmrcis an ini-formatted list of configs. if present, it is parsed. if theuserconfigoption is set in the cli or env, that file will be used instead. - Global Configs: the file found at
./etc/npmrc(relative to the global prefix) will be parsed if it is found. seenpm help prefixfor more info on the global prefix. if theglobalconfigoption is set in the cli, env, or user config, then that file is parsed instead. - 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 npmrcnpm help confignpm help installnpm help prefixnpm 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
- opensuse-leap 16.0: npm22 22.23.4-160000.1.1 Β· MIT
- opensuse-leap 16.0: npm22 22.23.4-160000.1.1 Β· MIT
- opensuse-leap 16.0: npm22 22.23.4-160000.1.1 Β· MIT
- opensuse-leap 16.0: npm22 22.23.4-160000.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms