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

NPM error when trying to install gulp and bower

我正在尝试通过 运行 npm install --global gulp bower 安装 gulp 和凉亭。一切似乎都很顺利,然后我明白了:

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,它做了同样的事情。

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

npm 3.x 与 yeoman

a couple of issues