NPM(1)

πŸ“¦
version 1.2.1 Β· 3 versions
, in nixos 26.05, nixpkgs unstable

πŸ’– 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 at https://img.shields.io/travis/npm/npm/master.svg and https://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 npm
  • npm help 7 faq
  • npm help help
  • npm 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