Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do global npm packages get installed on Ubuntu [closed]

Where is the default global node_modules folder on Ubuntu. For example where would this get installed: npm install -g gulp

like image 611
rob Avatar asked Jul 18 '14 17:07

rob


People also ask

Where do npm global installs go?

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.

Where is npm stored Linux?

On most systems, this is /usr/local . On Windows, it's %AppData%\npm . On Unix systems, it's one level up, since node is typically installed at {prefix}/bin/node rather than {prefix}/node.exe .

Where are npm packages stored locally?

local packages are installed in the directory where you run npm install <package-name> , and they are put in the node_modules folder under this directory. global packages are all put in a single place in your system (exactly where depends on your setup), regardless of where you run npm install -g <package-name>


1 Answers

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

like image 134
rob Avatar answered Oct 13 '22 10:10

rob