[英]How to change the npm prefix without config?
I accidentally changed the npm prefix to a place that doesn't exist.我不小心将 npm 前缀更改为一个不存在的地方。 Is there a configuration file I can access that would allow me to change this back?
有没有我可以访问的配置文件可以让我改回来?
The only options I can think of are:我能想到的唯一选择是:
But it seems like there should be a config file I can change somewhere, right?但似乎应该有一个配置文件我可以在某处更改,对吧?
prefix
can be defined per-install and other commands using --prefix
, but as a global setting it is in ~/.npmrc
( C:\\Users\\<your user name>\\.npmrc
). prefix
可以使用--prefix
在每次安装和其他命令中定义,但作为全局设置,它位于~/.npmrc
( C:\\Users\\<your user name>\\.npmrc
)中。 You can remove / edit it directly in that file. 您可以直接在该文件中删除/编辑它。
You can also use npm config set prefix $value
, or npm config delete prefix
if you prefer. 您也可以根据需要使用
npm config set prefix $value
或npm config delete prefix
。
一个简单的ln -s \/usr\/local\/bin\/n \/usr\/bin\/n<\/code>已经解决了这个问题。
"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.