Skip to content
Newer
Older
100644 126 lines (79 sloc) 3.79 KB
492924c @isaacs Move more of the documentation to ronn's domain
isaacs authored
1 # npm
4626dfa Initial drop. Ugly, sketchy, and not even yet quite a "work in progre…
isaacs authored
2
069a27c @isaacs Add a simpler install process up near the top.
isaacs authored
3 This is just enough info to get you up and running.
b3f1673 @isaacs another note pointing users to the documentation
isaacs authored
4
0164a0d @isaacs Make the "don't use sudo" explanation clearer.
isaacs authored
5 More info available via `npm help` once it's installed.
841f3b5 @isaacs Move the installing section up to the top
isaacs authored
6
266f1c9 @isaacs Update the README with more helpful info.
isaacs authored
7 ## IMPORTANT
8
9 You need node v0.2.0 or higher to run this program.
10
11 You shouldn't use sudo with it.
12
069a27c @isaacs Add a simpler install process up near the top.
isaacs authored
13 ## Simple Install
841f3b5 @isaacs Move the installing section up to the top
isaacs authored
14
5885cbf @isaacs Update readme to reference super duper easy install script.
isaacs authored
15 To install npm, do this:
d49a887 @isaacs add some more installation suggestions/options
isaacs authored
16
5885cbf @isaacs Update readme to reference super duper easy install script.
isaacs authored
17 curl http://npmjs.org/install.sh | sh
d49a887 @isaacs add some more installation suggestions/options
isaacs authored
18
0164a0d @isaacs Make the "don't use sudo" explanation clearer.
isaacs authored
19 ## Permission Errors
20
57729b7 @isaacs Documentation updates
isaacs authored
21 If it dies with a "Permission Denied" or EACCESS error, then that probably
266f1c9 @isaacs Update the README with more helpful info.
isaacs authored
22 means that you are running node in a shared root-owned location. You've
23 got options.
57729b7 @isaacs Documentation updates
isaacs authored
24
0164a0d @isaacs Make the "don't use sudo" explanation clearer.
isaacs authored
25 Using sudo with npm is Very Not Recommended. Anyone can publish anything,
26 and package installations can run arbitrary scripts.
27
28 ### Option 1: Take ownership
29
30 This is good if you have a single-user machine. Run this command once, and
31 never use sudo again to install stuff in /usr/local:
32
33 sudo chown -R $USER /usr/local
34
35 You could also give your user permission to write into that directory by
36 making it group-writable and adding your user to the group that owns it.
37
38 ### Option 2: Don't leave $HOME
39
40 Install node in `$HOME/local` and npm will default to living right alongside
41 it. Follow the steps in this gist: <http://gist.github.com/579814>
42
43 ### Option 3: Customize npm to your heart's content
44
45 Create and edit a file at `~/.npmrc`. This is an ini-formatted file, which
46 you can use to set npm configs. Do something like this to it:
47
48 cat >>~/.npmrc <<NPMRC
61fea1c @isaacs Make the .npmrc sample more clear, and add some words about sudoing
isaacs authored
49 root = ~/.node_libraries
50 binroot = ~/bin
51 manroot = ~/share/man
0164a0d @isaacs Make the "don't use sudo" explanation clearer.
isaacs authored
52 NPMRC
53
54 ### Option 4: HOLY COW NOT RECOMMENDED!!
55
56 You *can* just use sudo all the time for everything, and ignore the incredibly
57 obnoxious warnings telling you that you're insane for doing this.
58
59 # you must REALLY trust me to do this!
60 curl http://npmjs.org/install.sh | sudo sh
61 sudo npm ls
62 sudo npm install please-pwn-my-machine-kthx
63
64 If this causes horrible things to happen, you can't say I didn't warn you over
65 and over again until everyone got sick of hearing about it and told me to shut
66 up already.
d49a887 @isaacs add some more installation suggestions/options
isaacs authored
67
61fea1c @isaacs Make the .npmrc sample more clear, and add some words about sudoing
isaacs authored
68 It is on the roadmap to make npm do a bunch of chown/setuid stuff when sudoed,
69 so eventually it'll actually be *safer* to run as root than as a user account,
70 but that's a refactor that is slowly progressing.
71
72 If you have feelings about sudo use and what it should imply, then please go add
73 some comments and thoughts on [this issue](http://github.com/isaacs/npm/issues/issue/294).
74
069a27c @isaacs Add a simpler install process up near the top.
isaacs authored
75 ## More Fancy Installing
76
77 First, get the code. Maybe use git for this. That'd be cool. Very fancy.
78
bf84068 @isaacs update make stuff in the README
isaacs authored
79 The default make target is `install`, which downloads the current stable
895281c @isaacs Update install instructions.
isaacs authored
80 version of npm, and installs that for you.
069a27c @isaacs Add a simpler install process up near the top.
isaacs authored
81
895281c @isaacs Update install instructions.
isaacs authored
82 If you want to install the exact code that you're looking at, the bleeding-edge
83 master branch, do this:
84
bf84068 @isaacs update make stuff in the README
isaacs authored
85 make dev
069a27c @isaacs Add a simpler install process up near the top.
isaacs authored
86
87 If you'd prefer to just symlink in the current code so you can hack
88 on it, you can do this:
89
895281c @isaacs Update install instructions.
isaacs authored
90 make link
91
92 If you check out the Makefile, you'll see that these are just running npm commands
93 at the cli.js script directly. You can also use npm without ever installing
266f1c9 @isaacs Update the README with more helpful info.
isaacs authored
94 it by using `node cli.js` instead of "npm". Set up an alias if you want, that's
95 fine. (You'll still need read permission to the root/binroot/manroot folders,
96 but at this point, you probably grok all that anyway.)
069a27c @isaacs Add a simpler install process up near the top.
isaacs authored
97
c71ae65 @isaacs version notes for 0.1.11
isaacs authored
98 ## Uninstalling
99
100 So sad to see you go.
101
102 npm uninstall npm
103
104 Or, if that fails,
105
106 make uninstall
d9e9c14 @isaacs Point developers to the docs
isaacs authored
107
266f1c9 @isaacs Update the README with more helpful info.
isaacs authored
108 ## Install Problems
109
110 There's was an issue prior to npm version 0.2.0 where packages whose names contained
111 hyphen characters would be odd.
112
113 If you've installed any packages with `-` in the name prior to 0.2.0, then you ought
114 to remove and reinstall them.
115
d9e9c14 @isaacs Point developers to the docs
isaacs authored
116 ## More Docs
117
118 Check out the [docs](http://github.com/isaacs/npm/blob/master/doc/).
119
5885cbf @isaacs Update readme to reference super duper easy install script.
isaacs authored
120 You can use the [npm help](http://github.com/isaacs/npm/blob/master/doc/help.md#readme)
121 command to read any of them.
122
d9e9c14 @isaacs Point developers to the docs
isaacs authored
123 If you're a developer, and you want to use npm to publish your program,
124 you should
125 [read this](http://github.com/isaacs/npm/blob/master/doc/developers.md#readme)
Something went wrong with that request. Please try again.