2

我正试图让约曼工作,但它是一堵又一堵墙。感谢上帝的 stackoverflow 和所有帮助的好人。无论如何 ...

我一直在努力奔跑yo angular。但我得到了一堆,npm ERR!包括:

npm ERR! Please try running this command again as root/Administrator.

由于我不能在 yo 上使用 sudo,所以我遵循了大多数接受的建议并更改了一些配置,希望能解决这个问题。以下是我根据建议运行的命令。

但我仍然遇到同样的错误!

这是我yo angularnpm-debug.log

这是我yo angularstderr.log

这是我yo angularstdout.log

我应该如何修复这些错误?

非常感谢你。


更新:

在 alex 的建议之后,以 root 身份运行的错误确实消失了,但是在新目录中sudo chown ubuntu /home/ubuntu/tmp -Rv运行后我仍然有这些错误。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:经过一些研究,我解决了这个新的 ENOENT 问题sudo npm cache clear

感谢 StackOverflow。

4

2 回答 2

6

80 错误 错误:EACCES,mkdir '/home/ubuntu/tmp/npm-26883-sBYbfAy6'

好的,所以您的/home/ubuntu/tmp权限错误。这是因为你sudo npm install过去做过,而 npm 处理得不够好。

运行sudo chown ubuntu /home/ubuntu/tmp -Rv以解决此问题,或者只是删除该文件夹。

于 2014-02-18T00:55:23.730 回答
1

即使在应用了上面的修复程序之后,我也遇到了各种疯狂的错误,最后我运行了“chmod -R 777 /home/[moi]/.npm,它现在运行没有任何错误。

于 2014-05-24T14:22:24.857 回答