echo $NODE_PATH returns two global installation pa

2019-09-08 07:49发布

问题:

echo $NODE_PATH

returns

/Users/swills/.npm-packages/lib/node_modules::/Users/swills/npm/lib/node_modules

Running npm install -g express-generator installs express-generator in both:

/Users/swills/.npm-packages/lib/node_modules

and

/Users/swills/npm/lib/node_modules

Might this cause future dependency issues? If so, how can I fix this?

I've installed node several times for updates, and once or twice to avoid having to use sudo. I think that might have something to do with it. I vaguely remember using either the first (node-and-npm-in-30-seconds.sh) or second (only-git-all-the-way.sh) option from this github gist: https://gist.github.com/isaacs/579814

回答1:

First are you sure that not both are needed in the environment variable? i.e does these two paths contain the exact same files? Second if they are infact the same, use the "which" command to know which is the default one. For example if you have two different jdks installed, upon calling "which java" will return the path to the default one first.