npm安装失败导致npm ERR



我想全局安装gulp,所以我使用这个命令,

npm install gulp -g

然后抛出这个错误:

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "E:\nodejs\node.exe" "E:\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "gulp"
npm ERR! node v6.5.0
npm ERR! npm  v3.10.3
npm ERR! path E:nodejsnode_globalgulp
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR! syscall open
npm ERR! eisdir EISDIR: illegal operation on a directory, open 'E:nodejsnode_globalgulp'
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
npm ERR! Please include the following file with any support request:
npm ERR!     H:npm-debug.log

看起来错误发生是因为当它想打开一个目录时,实际上它是一个文件。我检查了node_global director,发现了一个名为gulp的文件。CMD和一个名为gulp的文件。所以他们之间可能会有冲突

这是一个简单的问题。我用这个

来设置npm的配置
cache=E:nodejsnode_global
prefix=E:nodejsnode_global

缓存和前缀不应该放在同一个目录中。也许我只是不小心改了。编码:快乐)

最新更新