Windows 已安装 node.js 但未找到 npm [英] Windows -installed node.js but npm not found
问题描述
我认为 npm 会在 Windows 上与最新的 node.js 安装程序一起自动安装.但是,当我尝试在命令控制台中使用 npm 时,出现以下错误
I thought npm is automatically installed with the latest node.js installer on Windows. However when I try and use npm in the command console I get the following error
C:npm install socketio
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\foo\node_modules\npm\bin\n
pm-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
我检查了并且 npm 确实存在于 nodejs Program Files 目录中.那么这是PATH环境问题吗?如果是这样,我该如何解决,以便我可以在任何打开命令控制台窗口的地方使用 npm?
I checked and npm DOES exist in the nodejs Program Files directory. So is this a PATH environment issue? And if so, how do I resolve so I can use npm anywhere I open a command console window?
推荐答案
您在尝试什么版本的 Windows?您还需要检查是否安装了依赖项以获取更多信息,请查看链接,https://www.npmjs.org/package/socket.io
What version of the windows are you trying? And also you need to check the dependencies are installed for more information check the link, https://www.npmjs.org/package/socket.io
这篇关于Windows 已安装 node.js 但未找到 npm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!