npm更改前缀后没有响应 [英] npm not responding after changing the prefix
问题描述
我最近尝试通过npm更新我的IONIC CLI,安装成功了几次但CLI版本没有改变。经过研究后我决定更改npm前缀,然后IONIC strated抛出bash:未找到IONIC命令。然后我做了进一步的研究,之后我通过windows cmd admin编辑了npm配置。我做了
I tried updating my IONIC CLI through the npm recently, the installation were successful a couple of time but the CLI version did not change. After a research I decided to change the npm prefix, then the IONIC strated throwing up bash: IONIC command not found. Then I did a further research after which I edited the npm config through windows cmd admin. I did
npm cofig edit
我将前缀更改为
\users\<username>\
此后,npm不再响应。
since then, npm no longer respond.
如果我运行类似
npm install -g ionic
没有任何反应,没有错误或任何形式的回应。
我已卸载并重新安装该节点几次。我正在使用节点V4.2.2。
nothing happens, no errors nor any form of response. I have uninstall and reinstall the node several time. I am using node V4.2.2.
推荐答案
我终于找到了解决这个问题的方法。这些是我做的
I finally found a way around this . These are what I did
-
我删除了所有应用程序中的所有node_module文件夹(我不确定这是否真的有必要)
I deleted all the node_module folders in all my application (I am not sure if this is really necessary )
我按照 https完全卸载了该节点://stackoverflow.com/a/20711410/1363169
我跑了
npm root -g
返回路径
C:\Users\<username>\node_module
而不是
/usr/local
或安装节点的地方,在我自己的情况下节点安装在
or wherever node is installed , in my own case node is install in
C:\Users\<username>\AppData\Roaming\npm
然后我跑
npm config set prefix "C:\Users\<username>\AppData\Roaming\npm"
然后我又重新安装了cordova和离子
Then I reinstalled cordova and ionic again
npm install -g cordova
npm install ionic -g
一切都很好
这篇关于npm更改前缀后没有响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!