简体   繁体   English

安装 Node.js 但 npm 模块未找到错误

[英]installed Node.js but npm module not found error

I downloaded node.js from nodejs.org,today i tried to check my npm version(from cmd prompt /windows power shell/ vs code) but it was giving me same error but when i tried it from node.js cmd prompt it works fine i wanted to resolve error in vs code and cmd I downloaded node.js from nodejs.org,today i tried to check my npm version(from cmd prompt /windows power shell/ vs code) but it was giving me same error but when i tried it from node.js cmd prompt it works fine i wanted to解决 vs 代码和 cmd 中的错误

Error shown in vs code vs代码中显示的错误

Error shown in cmd cmd 中显示的错误

node.js cmd prompt (here it works) node.js cmd 提示(在这里有效)

I thought that there may be some problem in path I tried several path but nothing changed我认为路径可能有问题我尝试了几条路径但没有任何改变

path小路

I guess it's the problem with your path.我想这是你的路径的问题。

Try deleting this path -- C:\Users\sande\AppData\Roaming\npm\node_modules\npm尝试删除此路径 -- C:\Users\sande\AppData\Roaming\npm\node_modules\npm

Also, try restarting your PC.另外,请尝试重新启动您的 PC。

I had to install nvm and it solved my problem there may be error because of space in my username我必须安装 nvm,它解决了我的问题,因为我的用户名中的空间可能会出错

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM