NPM(1)
โจ NAME โจ
okay so bestie, you opened NPM(1) โ that's the manual page for npm, the javascript package manager ๐
and yes this entire page is about to be your new hyperfixation.
Synopsis ๐
npm
โ ๏ธ heads up: this command is unaware of workspaces. like, it literally does not know they exist. not me being dramatic, that's just canon.
Version ๐ธ
12.2.1 โ write it down, bestie.
๐ DESCRIPTION ๐
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 (the way that it just... handles it? iconic).
it is extremely configurable, like genuinely built 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 all the available commands. slay.
๐ฅ 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.
you can configure npm to use any compatible registry you like, and you can even run your own registry (main character energy honestly). use of someone else's registry is governed by their terms of use โ so like, read those, bestie, fr fr.
๐ฆ Introduction ๐ฆ
you probably got npm because you want to install stuff. that's it. that's the reason. no cap.
the very first thing you will most likely want to run in any node program is npm install โ that installs its dependencies. periodt.
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 a lot 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. chefs kiss ๐
๐ Dependencies ๐
if a package lists a dependency using a git URL, npm will install that dependency using the git โจhttps://github.com/git-guides/install-gitโฉ command and will generate an error if it is not installed. so like, install git. ๐
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โฉ.
๐ญ yes you actually need the buildchain. no you can't skip it. sorry bestie.
๐ Directories ๐
see npm help folders to learn about where npm puts stuff.
in particular, npm has two modes of operation:
- local mode:
npminstalls 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:
npminstalls 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 apackage.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. usenpm 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 vianpm help install.login: log in to the registry and store credentials. when you do this,npmwill store credentials in the user config file.publish: use thenpm help publishcommand to upload your code to the registry.
โญ 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. ๐
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. (yes the template matters, bestie, the maintainers are literally volunteering their time ๐ญ)
๐ 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 was NPM@12.2.1, dated October 2026 โ go install something iconic โจ๐
๐ฆ where this page comes from
- arch rolling: npm 12.2.1-1 ยท Artistic-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms