使用npm时找不到模块'readable-stream'

632*_*324 3 node.js npm

我安装了nodejs,并尝试在我的Windows机器上使用npm.我从nodejs网站下载了所有文件.我尝试安装最新4.4.2版本或5.10.1版本,但是Cannot find module 'readable-stream'当我尝试使用命令运行时,我总是遇到错误npm.

C:\Users\Ealon>node -v                                                             
v5.10.1                                                                             

C:\Users\Ealon>npm -v                                                              
module.js:341                                                                       
    throw err;                                                                      
    ^                                                                                                                                                                   
Error: Cannot find module 'readable-stream'                                         
    at Function.Module._resolveFilename (module.js:339:15)                          
    at Function.Module._load (module.js:290:25)                                     
    at Module.require (module.js:367:17)                                            
    at require (internal/module.js:16:19)                                           
    at Object.<anonymous> (C:\Users\Ealon\AppData\Roaming\npm\node_modules\npm\node
modules\npmlog\node_modules\are-we-there-yet\index.js:2:14)                         
    at Module._compile (module.js:413:34)                                           
    at Object.Module._extensions..js (module.js:422:10)                             
    at Module.load (module.js:357:32)                                               
    at Function.Module._load (module.js:314:12)                                     
    at Module.require (module.js:367:17)                                            
Run Code Online (Sandbox Code Playgroud)

我试图一次又一次地重新安装它,仍然无法解决这个问题.而另一个类似问题的答案没有帮助,因为当我尝试使用任何命令npm时,我总是遇到错误.任何帮助表示赞赏.谢谢!

dvl*_*lsg 5

C:\Users\Ealon\AppData\Roaming\npm\node_modules\npm\node modules\npmlog\node_modules\are-we-there-yet\index.js:2:14堆栈跟踪中的行判断,我相信你有一个npm内部依赖的全局安装are-we-there-yet,我确认它依赖于readable-stream.

全局安装npm似乎已被borked,并且由于某种原因are-we-there-yet无法解决对readable-stream模块的访问(安装错误?).

这没有通过重新安装来修复node,默认情况下安装npm到程序文件中(类似于路径C:\Program Files\nodejs\node_modules\npm).我认为全局版本正在运行,但程序文件中的版本应该正在运行,因此消除全局安装npm应该有希望解决问题.