尝试安装gulp和bower时出现NPM错误

时间:2015-11-30 18:46:03

标签: node.js npm gulp bower

我正在尝试运行npm install --global gulp bower来安装gulp和bower。一切似乎都很好,然后我明白了:

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "yo" "gulp" "bower"
npm ERR! node v4.2.2
npm ERR! npm  v3.5.0
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams' -> '/usr/local/lib/node_modules/gulp/node_modules/ordered-read-streams'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/ordered-read-streams' -> '/usr/local/lib/node_modules/gulp/node_modules/ordered-read-streams'
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/deang/npm-debug.log

我也尝试使用sudo运行命令,但无济于事。有什么指针吗?

更新

这似乎正在我正在尝试安装的所有内容中发生。刚试过sudo npm install --global generator-gulp-webapp,它做了同样的事情。

1 个答案:

答案 0 :(得分:1)

你正在使用npm 3.x吗?如果是这样,请尝试降级到npm 2.x(您可以npm install npm@2.14.12)。

npm 3.x与yeoman有enter image description here