【问题标题】:npm install failure with npm ERRnpm 安装失败并出现 npm ERR
【发布时间】: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事件。无论如何谢谢。

标签: node.js npm


【解决方案1】:

这是一个简单的问题。我用这个设置了npm的配置

cache=E:\nodejs\node_global
prefix=E:\nodejs\node_global

缓存和前缀不应该放在同一个director中。可能我只是不小心更改了它。快乐编码:)

【讨论】:

    猜你喜欢
    • 2022-06-23
    • 2016-02-27
    • 2016-11-08
    • 1970-01-01
    • 2018-05-11
    • 2022-01-26
    • 2018-04-30
    • 2021-05-30
    • 2017-02-04
    相关资源
    最近更新 更多