我正在努力让 Yeoman 工作,但是却是一堵又一堵墙。感谢上帝的 stackoverflow 和所有好心人的帮助。无论如何 ...
我一直在努力奔跑yo angular
。但我得到了一堆npm ERR!
包括:
npm ERR! Please try running this command again as root/Administrator.
由于我无法在哟上使用 sudo,因此我遵循了大多数接受的建议并更改了一些配置,希望能够解决此问题。这是我运行的命令 https://gist.github.com/randwa1k/9061221,这是基于建议 https://gist.github.com/isaacs/579814.
但我仍然遇到同样的错误!
这是我的yo angular
's npm-debug.log https://gist.github.com/randwa1k/9061434
这是我的yo angular
's 标准错误日志 https://gist.github.com/randwa1k/9061458
这是我的yo angular
's 标准输出日志 https://gist.github.com/randwa1k/9061478
我应该如何修复这些错误?
预先非常感谢您。
Update:
在亚历克斯建议这样做之后sudo chown ubuntu /home/ubuntu/tmp -Rv
,以 root 身份运行错误确实消失了,但是运行后仍然有这些错误yo angular
在一个新目录中。我正在显示错误cat -n stderr.log | grep -ir err
(奇怪的是npm-debug.log
这次没有生成):
218 npm ERR! Error: ENOENT, lstat '/home/ubuntu/youtube_5/node_modules/grunt/lib/grunt/task.js'
219 npm ERR! If you need help, you may report this *entire* log,
220 npm ERR! including the npm and node versions, at:
221 npm ERR! <http://github.com/npm/npm/issues>
223 npm ERR! System Linux 3.2.0-54-virtual
224 npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-karma" "karma-ng-html2js-preprocessor" "karma-ng-scenario" "--save-dev"
225 npm ERR! cwd /home/ubuntu/youtube_5
226 npm ERR! node -v v0.10.25
227 npm ERR! npm -v 1.4.2
228 npm ERR! path /home/ubuntu/youtube_5/node_modules/grunt/lib/grunt/task.js
229 npm ERR! fstream_path /home/ubuntu/youtube_5/node_modules/grunt/lib/grunt/task.js
230 npm ERR! fstream_type File
231 npm ERR! fstream_class FileWriter
232 npm ERR! code ENOENT
233 npm ERR! errno 34
234 npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
235 npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
1102 npm ERR!
1103 npm ERR! Additional logging details can be found in:
1104 npm ERR! /home/ubuntu/youtube_5/npm-debug.log
1105 npm ERR! not ok code 0
更新2:经过一些research https://stackoverflow.com/q/17990647/3290121,我解决了这个新的 ENOENT 问题sudo npm cache clear
.
感谢 StackOverflow。