简体   繁体   English

NPM找不到模块,赢得7/64位

[英]NPM cant find module, win 7/64 bit

I just have installed node for windows 64 bit with the msi installer from node.js site, on windows 7 64 bit. 我刚刚在Windows 7 64位上使用来自node.js网站的msi安装程序为Windows 64位安装了node。 It sad that it install node path and npm(node package manager). 遗憾的是,它安装了节点路径和npm(节点程序包管理器)。 And when I type node in CMD it goes to interactive console and I can run .js scripts with it(it's working). 当我在CMD中键入node时,它会进入交互式控制台,并且我可以使用它运行.js脚本(正在运行)。 But when I type npm I get this error. 但是,当我键入npm时,会出现此错误。 I did not change any paths and it's a fresh install. 我没有更改任何路径,这是一个全新的安装。

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

好吧,显然,问题出在64位版本的Windows Installer中,32位工作正常!

I'd suggest downloading git bash for windows. 我建议为Windows下载git bash。 That should solve most cmd problems. 那应该解决大多数cmd问题。

您可以将PATH变量更改为C:\\Program Files\\nodejs'而不是C:\\Program Files\\nodejs\\node_modules\\npm\\bin

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

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