UNPKG

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