Windows -installed node.js but npm not found

2019-09-16 00:54发布

问题:

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

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?

回答1:

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



标签: node.js npm