【问题标题】:Error code -2 when installing gulp安装 gulp 时出现错误代码 -2
【发布时间】:2015-08-30 06:47:02
【问题描述】:

我正在尝试在 OSX 上使用 Node.js 安装 Gulp,但出现了问题。这就是我所做的。

  • 我安装了node.js
  • 使用sudo npm init创建package.json文件
  • 使用sudo npm install —save-dev gulp

此时出现了错误。

npm WARN package.json dependencies@1.0.0 No description
npm WARN package.json dependencies@1.0.0 No repository field.
npm WARN package.json dependencies@1.0.0 No README data
npm ERR! addLocal Could not install /Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "—save-dev" "gulp"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev
npm ERR! code ENOENT
npm ERR! errno -2

npm ERR! enoent ENOENT, open '/Users/dorinocanciani/Sites/prova/resources/dependencies/—save-dev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dorinocanciani/Sites/prova/resources/dependencies/npm-debug.log

我在谷歌搜索了很多,但没有找到此类错误的结果。 请问您能帮我解决错误吗?

【问题讨论】:

    标签: node.js gulp


    【解决方案1】:

    您在命令中错过了-,它应该是:npm install --save-dev gulp

    更新:您似乎根本没有使用 -,但这个 是另一个字符并且是错误的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-11-15
      • 2020-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-07
      • 1970-01-01
      相关资源
      最近更新 更多