NPM(1)
π NAME π
okay so welcome to the npm(1) page bestie β npm is the javascript package manager and it's genuinely about to make your whole dev life easier π
β¨ Synopsis β¨
npm
π«Ά heads up queen: this command is unaware of workspaces. like, it literally does not know they exist. noted!
π Version π
11.19.1 β that's the version, no cap β¨
πΈ Description πΈ
so npm is the package manager for the Node JavaScript platform, periodt. it puts modules in place so node can actually find them, and it manages dependency conflicts intelligently (iconic behaviour honestly π).
it's extremely configurable β like, ridiculously so β to support a whole bunch of use cases. but the most common things you'll use it for are: publish, discover, install, and develop node programs π¦
run npm help to get a list of all the available commands, iykyk π
π₯ Important π₯
npm comes preconfigured to use npm's public registry at https://registry.npmjs.org by default. using the npm public registry is subject to the terms of use available at https://docs.npmjs.com/policies/terms β so like, read those bestie π
you can configure npm to use any compatible registry you like, and you can even run your own registry. no gatekeeping π
β οΈ but if you're using someone else's registry, that's governed by their terms of use. not ours. just so we're clear π«Ά
π Introduction π
you probably got npm because you want to install stuff. same, honestly π
the very first thing you'll most likely want to run in any node program is npm install to install its dependencies. that's the vibe β¨
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. easy π
π§ 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. and yeah, node-gyp β¨https://github.com/nodejs/node-gypβ© has needs:
- on a Unix system, node-gyp β¨https://github.com/nodejs/node-gypβ© needs Python, make, and a buildchain like GCC
- on Windows, you need Python and Microsoft Visual Studio C++
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β© π«Ά
π 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 π
π Developer Usage π
if you're using npm to develop and publish your code, check out the following help topics β think of it as a lil starter pack π
- 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 π¦ - 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's so many π
- 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, don't. fr fr π
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 there for a reason bestie, it's giving organized β¨
π₯ 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 page!! π this was NPM@11.19.1, dated August 2026 β slay, go install something iconic π§β¨π
π¦ where this page comes from
- centos-stream 10: nodejs26-npm 1:11.19.1-1.26.8.2.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