错误module.js:471 throw err;更新node.js之后

时间:2017-10-25 17:17:18

标签: node.js npm

将Node.js更新为6.11.5后,我收到以下错误

$ npm install
module.js:471
    throw err;
    ^

Error: Cannot find module 'buffer-shims'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Direcode\AppData\Roaming\npm\node_modules\npm\node_modules\readable-stream\lib\_stream_readable.js:36:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

2 个答案:

答案 0 :(得分:0)

尝试直接安装此模块:

npm install buffer-shims

答案 1 :(得分:0)

the author所述,您可以按照以下步骤解决此问题:

  1. 卸载Node.js
  2. 删除npm文件夹(user/myuser/AppData/Roaming
  3. 重新安装Node.js