Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

npm installs all modules in /usr/local/lib/node_modules/

npm installs all modules in /usr/local/lib/node_modules/

Problem

I have node.js 0.8.14 installed on Ubuntu 12.10. I created a directory in my home directory with a sub directory node_modules. I want to install some local node modules there but running
npm install myModule in this directory installs this module in /usr/local/lib/node_modules/ (same behavior as installing the module with the -g flag

There is no node path in .bashrc.

Any idea how I can install local node modules?

Problem courtesy of: vsdev

Solution

After some further research I found the solution.

Running the command npm config ls revealed that the default config global=false (you see the default config with npm config ls -l) was overwritten by global=true in /home/vsdev/.npmrc and /usr/local/etc/npmrc.

Reverting this to global=false solved the issue.

Solution courtesy of: vsdev

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

npm installs all modules in /usr/local/lib/node_modules/

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×