Where is the default global node_modules folder on Ubuntu. For example where would this get installed: npm install -g gulp
Asked
Active
Viewed 7.8k times
92

rob
- 17,995
- 12
- 69
- 94
-
3my gut tells me this would be better to ask on SU or AU (super user or ask ubuntu). – rlemon Jul 18 '14 at 17:24
-
Not sure why you created this, there's plenty of information out there already. – SomeKittens Jul 18 '14 at 17:25
-
1I've had to google this several times and it always takes me a while to track down so I'm just posting it here to make it easier to find – rob Jul 18 '14 at 17:25
-
well, like my original comment stated: this is more about a tool and less about an actual programming problem, so it should be on one of the aforementioned sites. – rlemon Jul 18 '14 at 17:27
-
6https://www.npmjs.org/doc/files/npm-folders.html – Zirak Jul 18 '14 at 17:28
1 Answers
129
Run npm root -g
to see the location, which varies. A common path is /usr/local/lib/node_modules.
For more info see the npm docs on Global vs. Local installation
-
127
-
12@Zirak please consider putting this as an answer as it's actually more useful than the accepted one, thanks! – Trufa May 20 '15 at 13:25
-
4
-
4@Zirak His comment should be the answer--that link is long dead. – Daniel B. Chapman Sep 17 '16 at 01:44
-
20`npm root -g` yields `/usr/lib/node_modules` on my Ubuntu installation. – kleinfreund Nov 19 '16 at 08:15
-
1
-
2`npm root -g` returns `/home/ubuntu/.npm-global/lib/node_modules` on EC2 ubuntu. – Jeff McMahan Oct 27 '17 at 18:12
-
1This answer is generally incorrect. As pointed out many times, npm root -g, will give you the actual location. – Display name Nov 18 '17 at 03:34
-
3
-