UNPKG

4.66 kBMarkdownView Raw
1npm(1) -- a JavaScript package manager
2==============================
3
4[![Build Status](https://img.shields.io/travis/npm/npm/latest.svg)](https://travis-ci.org/npm/npm)
5
6## SYNOPSIS
7
8This is just enough info to get you up and running.
9
10Much more info available via `npm help` once it's installed.
11
12## IMPORTANT
13
14**You need node v4 or higher to run this program.**
15
16To install an old **and unsupported** version of npm that works on node v0.12
17and prior, clone the git repo and dig through the old tags and branches.
18
19**npm is configured to use npm, Inc.'s public package registry at
20<https://registry.npmjs.org> by default.**
21
22You can configure npm to use any compatible registry you
23like, and even run your own registry. Check out the [doc on
24registries](https://docs.npmjs.com/misc/registry).
25
26Use of someone else's registry may be governed by terms of use. The
27terms of use for the default public registry are available at
28<https://www.npmjs.com>.
29
30## Super Easy Install
31
32npm is bundled with [node](https://nodejs.org/en/download/).
33
34### Windows Computers
35
36[Get the MSI](https://nodejs.org/en/download/). npm is in it.
37
38### Apple Macintosh Computers
39
40[Get the pkg](https://nodejs.org/en/download/). npm is in it.
41
42### Other Sorts of Unices
43
44Run `make install`. npm will be installed with node.
45
46If you want a more fancy pants install (a different version, customized
47paths, etc.) then read on.
48
49## Fancy Install (Unix)
50
51There's a pretty robust install script at
52<https://www.npmjs.com/install.sh>. You can download that and run it.
53
54Here's an example using curl:
55
56```sh
57curl -L https://www.npmjs.com/install.sh | sh
58```
59
60### Slightly Fancier
61
62You can set any npm configuration params with that script:
63
64```sh
65npm_config_prefix=/some/path sh install.sh
66```
67
68Or, you can run it in uber-debuggery mode:
69
70```sh
71npm_debug=1 sh install.sh
72```
73
74### Even Fancier
75
76Get the code with git. Use `make` to build the docs and do other stuff.
77If you plan on hacking on npm, `make link` is your friend.
78
79If you've got the npm source code, you can also semi-permanently set
80arbitrary config keys using the `./configure --key=val ...`, and then
81run npm commands by doing `node bin/npm-cli.js <command> <args>`. (This is helpful
82for testing, or running stuff without actually installing npm itself.)
83
84## Windows Install or Upgrade
85
86Many improvements for Windows users have been made in npm 3 - you will have a better
87experience if you run a recent version of npm. To upgrade, either use [Microsoft's
88upgrade tool](https://github.com/felixrieseberg/npm-windows-upgrade),
89[download a new version of Node](https://nodejs.org/en/download/),
90or follow the Windows upgrade instructions in the
91[npm Troubleshooting Guide](./TROUBLESHOOTING.md).
92
93If that's not fancy enough for you, then you can fetch the code with
94git, and mess with it directly.
95
96## Installing on Cygwin
97
98No.
99
100## Uninstalling
101
102So sad to see you go.
103
104```sh
105sudo npm uninstall npm -g
106```
107Or, if that fails,
108
109```sh
110sudo make uninstall
111```
112
113## More Severe Uninstalling
114
115Usually, the above instructions are sufficient. That will remove
116npm, but leave behind anything you've installed.
117
118If you would like to remove all the packages that you have installed,
119then you can use the `npm ls` command to find them, and then `npm rm` to
120remove them.
121
122To remove cruft left behind by npm 0.x, you can use the included
123`clean-old.sh` script file. You can run it conveniently like this:
124
125```sh
126npm explore npm -g -- sh scripts/clean-old.sh
127```
128
129npm uses two configuration files, one for per-user configs, and another
130for global (every-user) configs. You can view them by doing:
131
132```sh
133npm config get userconfig # defaults to ~/.npmrc
134npm config get globalconfig # defaults to /usr/local/etc/npmrc
135```
136
137Uninstalling npm does not remove configuration files by default. You
138must remove them yourself manually if you want them gone. Note that
139this means that future npm installs will not remember the settings that
140you have chosen.
141
142## More Docs
143
144Check out the [docs](https://docs.npmjs.com/),
145
146You can use the `npm help` command to read any of them.
147
148If you're a developer, and you want to use npm to publish your program,
149you should [read this](https://docs.npmjs.com/misc/developers)
150
151## BUGS
152
153When you find issues, please report them:
154
155* web:
156 <https://github.com/npm/npm/issues>
157
158Be sure to include *all* of the output from the npm command that didn't work
159as expected. The `npm-debug.log` file is also helpful to provide.
160
161You can also look for isaacs in #node.js on irc://irc.freenode.net. She
162will no doubt tell you to put the output in a gist or email.
163
164## SEE ALSO
165
166* npm(1)
167* npm-help(1)
168* npm-index(7)