[英]npm install -g is installing to a local folder
I have been using node and npm for a while, and I just started a larger scale project using it. 我已经使用节点和npm已有一段时间了,而我刚刚开始使用它进行较大规模的项目。 Recently, however, whenever I run sudo npm install -g
, it will install it into a ~/Programming/usr/local/bin
instead of /usr/local/bin
. 但是,最近,每当我运行sudo npm install -g
,它将安装到~/Programming/usr/local/bin
而不是/usr/local/bin
。 Does anyone know why this is happening? 有人知道为什么会这样吗? How can I reset the installation location 如何重置安装位置
您可以通过运行以下命令来设置位置。
npm config set prefix /usr/local
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.