【发布时间】:2016-09-04 21:11:52
【问题描述】:
我想全局安装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:\nodejs\node_global\gulp
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR! syscall open
npm ERR! eisdir EISDIR: illegal operation on a directory, open 'E:\nodejs\node_global\gulp'
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
好像是因为要打开director的时候报错,其实是一个文件。我查了node_global的director,找到了一个叫gulp.cmd的文件,还有一个叫gulp的文件。所以可能有他们之间的冲突。
【问题讨论】:
-
什么是 E:?尝试使用常规程序文件文件夹。更多解决方案可能在这里github.com/nodejs/node/issues/6861
-
我通过更改配置解决了这个问题。似乎我在同一个director中配置了带有缓存和前缀的npm ...也许是bu事件。无论如何谢谢。