Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

package.json for global node_modules

I am not able to find the package.json for global node modules. Where is this global package.json file found? If it does not exist, how does node.js keep track of global node modules?

like image 788
guagay_wk Avatar asked Sep 15 '26 12:09

guagay_wk


1 Answers

There is no global package.json

npm doesn't keep track of globals, really. It just installs them in a common node_modules folder.

The binary or command file for the module is symlinked into an executable folder. for example, on my mac, the symlinks point to /user/local/bin

To install a global module, use the -g option when installing.

for example:

npm install -g express-generator

This will install the express-generator module into the global npm node_modules folder, and create the needed symlink to execute the express command line tool.

like image 125
Derick Bailey Avatar answered Sep 17 '26 13:09

Derick Bailey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!