NPM(1)
π NPM(1) β the npm manual, but make it make sense
okay so bestie, welcome to NPM(1), the manual page for npm β and yes, it's giving main character energy because literally every Node project on earth depends on it. Version 11.17.0, bestie. Let's go β¨
β¨ NAME β¨
npm β the javascript package manager π
β¨ SYNOPSIS β¨
npm
π heads up: this command is unaware of workspaces. Like, it genuinely does not know they exist. Not me finding that out the hard way.
β¨ VERSION β¨
11.17.0 β write it down, iykyk π¦
β¨ DESCRIPTION β¨
So npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and it manages dependency conflicts intelligently β which is honestly iconic of it, because dependency conflicts are the drama of the dev world and npm handles it for you. π
It is extremely configurable to support a variety of use cases. Most commonly, you use it to publish, discover, install, and develop node programs.
Run npm help to get a list of available commands. That's the group chat of commands, right there. π«Ά
π₯ 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. (yes, bestie, there are terms. read them. or at least know they exist. π)
You can configure npm to use any compatible registry you like, and you can even run your own registry. Use of someone else's registry is governed by their terms of use. no cap β that's their house, their rules. π
πΈ INTRODUCTION πΈ
You probably got npm because you want to install stuff. That's it. That's the vibe. π
The very first thing you will most likely want to run in any node program is npm install to install its dependencies. like, literally the first thing. do it. π«‘
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. fr fr, it's that girl. π
Use the npm search command to show everything that's available in the public registry. Use npm ls to show everything you've installed. search = window shopping, ls = closet tour. ποΈ
π§ 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, install git first, bestie. π
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. For a Unix system, node-gyp β¨https://github.com/nodejs/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β©. compile era = pain era, but we persist π
π DIRECTORIES π
See npm help folders to learn about where npm puts stuff. (yes, there's a whole other help page for the filing cabinet. love that for us.)
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. β¨
π DEVELOPER USAGE π
If you're using npm to develop and publish your code, check out the following help topics:
- json: Make a
package.jsonfile. Seepackage.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. (this one is a lifesaver, ngl π₯) - 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.
- publish: Use the
npm help publishcommand to upload your code to the registry. π
β CONFIGURATION β
npm is extremely configurable. It reads its configuration options from 5 places. five!! the way that it has five whole sources of truth π
- 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. respectfully, hands off.
See npm help config for much, much, more information. π
ποΈ 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.
π 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. (the template is not optional bestie, the maintainers will know π)
π FEATURE REQUESTS π
Discuss new feature ideas on our discussion forum:
Or suggest formal RFC proposals:
π SEE ALSO π
npm help helppackage.jsonβ¨/configuring-npm/package-jsonβ©npm help npmrcnpm help confignpm help installnpm help prefixnpm help publish
and that's the whole page, bestie! π this one is NPM@11.17.0, dated June 2026 β so when you cite it in your brain, that's the version and that's the date. slay, you now know npm. periodt. π β¨
π¦ where this page comes from
- centos-stream 10: nodejs24-npm 1:11.17.0-1.24.19.0.1.el10 Β· Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms