Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM Global Install Location on OSX

On OSX should NPM install global packages to:

/usr/local/lib/node_modules

or

/usr/local/share/npm
like image 349
Undistraction Avatar asked Jan 17 '14 18:01

Undistraction


People also ask

Where are global npm installed?

Path of Global Packages in the system: Global modules are installed in the standard system in root location in system directory /usr/local/lib/node_modules project directory. Command to print the location on your system where all the global modules are installed.

How do I find the npm path?

Try this: npm config get prefix will return the path.


2 Answers

The global packages get installed to:

/usr/local/lib/node_modules

and man pages get installed at (if supplied):

/usr/local/share/npm

see this for more information.

like image 114
l'L'l Avatar answered Oct 05 '22 23:10

l'L'l


The directory will differ depending on whether or not you're using nvm or some other node version manager, and possibly also based on versions of version manager and versions of OSX. Due to the variability here, it may be better to run npm root -g which will specify the directory npm is using to store your global modules.

like image 21
Gabriel Avatar answered Oct 05 '22 22:10

Gabriel