NPM(1)
👑 NPM(1) — the npm manual, bestie edition
okay so you're looking at the manual page for npm, which lives in section 1 of the manual (that's what the (1) means, iykyk). Let's get into it. 💅
✨ NAME ✨
npm — the javascript package manager. that's it, that's the whole name. short, iconic, does numbers.
🌸 SYNOPSIS 🌸
npm
heads up bestie: this command is unaware of workspaces. fr fr. no cap.
🎀 VERSION 🎀
10.9.8
💖 DESCRIPTION 💖
npm is the package manager for the Node JavaScript platform. what does it actually do? it puts modules in place so that node can find them, and it manages dependency conflicts intelligently. like a tiny genius librarian for your code. 📚✨
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. yes literally just that. 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 even run your own registry. use of someone else's registry is governed by their terms of use. so like, read the room (and their ToS). 🫶
🦋 INTRODUCTION 🦋
you probably got npm because you want to install stuff. relatable. that's the whole vibe.
the very first thing you will most likely want to run in any node program is npm install to install 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, it's giving overachiever.
use the npm search command to show everything that's available in the public registry. use npm ls to show everything you've installed. 👀
🧚 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⟩). 💀 it's a whole thing but you got this.
🌈 DIRECTORIES 🌈
see npm help folders to learn about where npm puts stuff. (yes, that's a real help topic, go look.)
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. main character energy, but for your whole machine. 👑
💅 DEVELOPER USAGE 💅
if you're using npm to develop and publish your code, check out the following help topics:
json: make apackage.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. 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.adduser: create an account or log in. when you do this, npm will 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. five. cinco. 🖐️✨
- 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. 🚫 do not touch. hands off. not yours.
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. they're not being extra, the template genuinely helps. 🙈
🌟 FEATURE REQUESTS 🌟
discuss new feature ideas on our discussion forum:
or suggest formal RFC proposals:
big brain ideas go here, bestie. 🧠✨
👀 SEE ALSO 👀
npm help help- package.json ⟨/configuring-npm/package-json⟩
npm help npmrcnpm help confignpm help installnpm help prefixnpm help publish
and that's the whole page! this one's from NPM@10.9.8, dated March 2026, sitting pretty in the NPM(1) section of your manual. go install something iconic, bestie. mwah 💖🎀🦋
📦 where this page comes from
- fedora 44: nodejs22-npm 1:10.9.8-1.22.23.1.2.fc44 · 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 on : a language model's rewrite of the original, under its terms