echo $NODE_PATH returns two global installation paths

自作多情 提交于 2020-01-06 09:07:23

问题


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.



来源:https://stackoverflow.com/questions/32596623/echo-node-path-returns-two-global-installation-paths

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!