NPM(1)
π NPM(1) π
okay so this is the man page for npm β a JavaScript package manager, bestie. that's literally the whole vibe of the NAME section, and honestly? iconic.
the build status badges live athttps://img.shields.io/travis/npm/npm/master.svgandhttps://travis-ci.org/npm/npmβ no cap, that's where they're at β¨
πΈ SYNOPSIS πΈ
this is literally just enough info to get you up and running fr fr π«Ά
much more info is available via npm help once it's installed. slay.
β οΈ IMPORTANT β οΈ
you need node v0.10 or higher to run this program. that's the bar, babes.
if you're out here wanting to install an old and unsupported version of npm that works on node 0.3 and prior, you gotta clone the git repo and dig through the old tags and branches. it's giving archaeology π
npm is configured to use npm, Inc.'s public package registry at https://registry.npmjs.org by default.
you can configure npm to use any compatible registry you like, and even run your own registry. check out the doc on registries at https://docs.npmjs.com/misc/registry π
use of someone else's registry may be governed by terms of use. the terms of use for the default public registry are available at https://www.npmjs.com. read 'em, bestie π
π Super Easy Install π
npm is bundled with node β http://nodejs.org/download/ β periodt.
Windows Computers
get the MSI from http://nodejs.org/download/. npm is in it. that's it. that's the whole step π
Apple Macintosh Computers
get the pkg from http://nodejs.org/download/. npm is in it. again. same energy π
Other Sorts of Unices
run make install. npm will be installed with node. easy peasy π
if you want a more fancy pants install (a different version, customized paths, etc.) then read on, gorgeous π
β¨ Fancy Install (Unix) β¨
there's a pretty robust install script at https://www.npmjs.com/install.sh. you can download that and run it.
here's an example using curl:
curl -L https://www.npmjs.com/install.sh | sh
Slightly Fancier
you can set any npm configuration params with that script:
npm_config_prefix=/some/path sh install.sh
or, you can run it in uber-debuggery mode ππ:
npm_debug=1 sh install.sh
Even Fancier
get the code with git. use make to build the docs and do other stuff. if you plan on hacking on npm, make link is your friend π«Ά
if you've got the npm source code, you can also semi-permanently set arbitrary config keys using the ./configure --key=val ..., and then run npm commands by doing node cli.js <cmd> <args>. (this is helpful for testing, or running stuff without actually installing npm itself.) iykyk π§
π¦ Windows Install or Upgrade π¦
you can download a zip file from https://github.com/npm/npm/releases, and unpack it in the node_modules\npm\ folder inside node's installation folder.
to upgrade to npm 2, follow the Windows upgrade instructions in the npm Troubleshooting Guide:
https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows
if that's not fancy enough for you, then you can fetch the code with git, and mess with it directly. main character energy π₯
π Installing on Cygwin π
No.
(that's the whole section. i'm not even kidding. the man page said No. πππ)
π§οΈ Uninstalling π§οΈ
so sad to see you go π
sudo npm uninstall npm -g
or, if that fails,
sudo make uninstall
πͺοΈ More Severe Uninstalling πͺοΈ
usually, the above instructions are sufficient. that will remove npm, but leave behind anything you've installed.
if you would like to remove all the packages that you have installed, then you can use the npm ls command to find them, and then npm rm to remove them.
to remove cruft left behind by npm 0.x, you can use the included clean-old.sh script file. you can run it conveniently like this:
npm explore npm -g -- sh scripts/clean-old.sh
npm uses two configuration files, one for per-user configs, and another for global (every-user) configs. you can view them by doing:
npm config get userconfig # defaults to ~/.npmrc
npm config get globalconfig # defaults to /usr/local/etc/npmrc
uninstalling npm does not remove configuration files by default. you must remove them yourself manually if you want them gone. note that this means that future npm installs will not remember the settings that you have chosen. so likeβ¦ choose wisely bestie π
π More Docs π
check out the docs at https://docs.npmjs.com/, especially the faq at https://docs.npmjs.com/misc/faq. highly recommend, ngl.
you can use the npm help command to read any of them π
if you're a developer, and you want to use npm to publish your program, you should read this: https://docs.npmjs.com/misc/developers β go get that bag π
π BUGS π
when you find issues, please report them:
be sure to include all of the output from the npm command that didn't work as expected. the npm-debug.log file is also helpful to provide. seriously, paste it all, we want the whole thing πβ¨
you can also look for isaacs in #node.js on irc://irc.freenode.net. he will no doubt tell you to put the output in a gist or email. that's just how it's gonna go π
π SEE ALSO π
npm help npmnpm help 7 faqnpm help helpnpm help 7 index
and that's the whole page, bestie π«Ά this was the NPM(1) man page from March 2017 β go forth and install responsibly π β¨π
π¦ where this page comes from
- nixos 26.05: hueadm 1.2.1
- nixpkgs unstable: hueadm 1.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms