.TH "NPM" "1" "November 2023" "9.2.0" .SH "NAME" \fBnpm\fR .SH Synopsis .SH Version .P @VERSION@ .SH Description .P npm is the package manager for the Node JavaScript platform\. It puts .br modules in place so that node can find them, and manages dependency .br conflicts intelligently\. .P It is extremely configurable to support a variety of use cases\. Most .br commonly, you use it to publish, discover, install, and develop node .br programs\. .P Run \fBnpm help\fP to get a list of available commands\. .SH Important .P npm comes preconfigured to use npm's public registry at .br https://registry.npmjs.orgby default\. Use of the npm public registry is .br subject to terms of use available at .br https://docs.npmjs.com/policies/terms .P You can configure npm to use any compatible registry you like, and even .br run your own registry\. Use of someone else's registry is governed by .br their terms of use\. .SH Introduction .P You probably got npm because you want to install stuff\. .P The very first thing you will most likely want to run in any node .br program is \fBnpm install\fP to install its dependencies\. .P You can also run \fBnpm install blerg\fP to install the latest version of .br "blerg"\. Check out \fBnpm install\fP for more .br info\. It can do a lot of stuff\. .P Use the \fBnpm search\fP command to show everything that's available in the .br public registry\. Use \fBnpm ls\fP to show everything you've installed\. .SH Dependencies .P If a package lists a dependency using a git URL, npm will install that .br dependency using the \fBgit\fP .br command and will generate an error if it is not installed\. .P If one of the packages npm tries to install is a native node module and .br requires compiling of C++ Code, npm will use .br node\-gyp for that task\. .br For a Unix system, node\-gyp .br needs Python, make and a buildchain like GCC\. On Windows, .br Python and Microsoft Visual Studio C++ are needed\. For more information .br visit the node\-gyp repository and .br the node\-gyp Wiki\. .SH Directories .P See \fBfolders\fP to learn about where npm puts .br stuff\. .P In particular, npm has two modes of operation: .RS 1 .IP \(bu 2 local mode: .br npm installs packages into the current project directory, which .br defaults to the current working directory\. Packages install to .br \fB\|\./node_modules\fP, and bins to \fB\|\./node_modules/\.bin\fP\|\. .IP \(bu 2 global mode: .br npm installs packages into the install prefix at .br \fB$npm_config_prefix/lib/node_modules\fP and bins to .br \fB$npm_config_prefix/bin\fP\|\. .RE .P Local mode is the default\. Use \fB\-g\fP or \fB\-\-global\fP on any command to .br run in global mode instead\. .SH Developer Usage .P If you're using npm to develop and publish your code, check out the .br following help topics: .RS 1 .IP \(bu 2 json: .br Make a package\.json file\. See .br \fBpackage\.json\fP\|\. .IP \(bu 2 link: .br Links your current working code into Node's path, so that you don't .br have to reinstall every time you make a change\. Use \fBnpm link\fP to do this\. .IP \(bu 2 install: .br It's a good idea to install things if you don't need the symbolic .br link\. Especially, installing other peoples code from the registry is .br done via \fBnpm install\fP .IP \(bu 2 adduser: .br Create an account or log in\. When you do this, npm will store .br credentials in the user config file\. .IP \(bu 2 publish: .br Use the \fBnpm publish\fP command to upload your .br code to the registry\. .RE .SS Configuration .P npm is extremely configurable\. It reads its configuration options from .br 5 places\. .RS 1 .IP \(bu 2 Command line switches: .br Set a config with \fB\-\-key val\fP\|\. All keys take a value, even if they .br are booleans (the config parser doesn't know what the options are at .br the time of parsing)\. If you do not provide a value (\fB\-\-key\fP) then .br the option is set to boolean \fBtrue\fP\|\. .IP \(bu 2 Environment Variables: .br Set any config by prefixing the name in an environment variable with .br \fBnpm_config_\fP\|\. For example, \fBexport npm_config_key=val\fP\|\. .IP \(bu 2 User Configs: .br The file at \fB$HOME/\.npmrc\fP is an ini\-formatted list of configs\. If .br present, it is parsed\. If the \fBuserconfig\fP option is set in the cli .br or env, that file will be used instead\. .IP \(bu 2 Global Configs: .br The file found at \fB\|\./etc/npmrc\fP (relative to the global prefix will be .br parsed if it is found\. See \fBnpm prefix\fP for .br more info on the global prefix\. If the \fBglobalconfig\fP option is set .br in the cli, env, or user config, then that file is parsed instead\. .IP \(bu 2 Defaults: .br npm's default configuration options are defined in .br lib/utils/config\-defs\.js\. These must not be changed\. .RE .P See \fBconfig\fP for much much more information\. .SH Contributions .P Patches welcome! .P If you would like to help, but don't know what to work on, read the .br contributing .br guidelines and .br check the issues list\. .SH Bugs .P When you find issues, please report them: .br https://github.com/npm/cli/issues .P Please be sure to follow the template and bug reporting guidelines\. .SH Feature Requests .P Discuss new feature ideas on our discussion forum: .RS 1 .IP \(bu 2 https://github.com/npm/feedback .RE .P Or suggest formal RFC proposals: .RS 1 .IP \(bu 2 https://github.com/npm/rfcs .RE .SH See Also .RS 1 .IP \(bu 2 npm help .IP \(bu 2 package\.json .IP \(bu 2 npmrc .IP \(bu 2 npm config .IP \(bu 2 npm install .IP \(bu 2 npm prefix .IP \(bu 2 npm publish .RE