質問

I'm trying to get Yeoman to work but it's been one wall after another. Thank God for stackoverflow and all you nice people helping out. Anyways ...

I've been trying to run yo angular. But I'm getting a bunch of npm ERR! including:

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

Since I can't use sudo on yo, I followed the mostly accepted advice and changed some configuration hoping to fix this problem. Here are the commands I ran, which were based on the recommendation.

But I'm still getting the same error!

Here is my yo angular's npm-debug.log

Here is my yo angular's stderr.log

Here is my yo angular's stdout.log

How should I fix these errors?

Thank you so much in advance.


Update:

After alex's suggestion of doing sudo chown ubuntu /home/ubuntu/tmp -Rv, the run as root error did go away, however I still have these errors after running yo angular in a new directory. I'm displaying the errors with cat -n stderr.log | grep -ir err (it's strange that npm-debug.log wasn't generated this time):

   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

Update2: After some research, I solved this new ENOENT problem with sudo npm cache clear.

Thanks StackOverflow.

役に立ちましたか?

解決

80 error Error: EACCES, mkdir '/home/ubuntu/tmp/npm-26883-sBYbfAy6'

Okay, so your /home/ubuntu/tmp has wrong permissions. It happened because you did sudo npm install in the past, and npm doesn't handle this well enough.

Run sudo chown ubuntu /home/ubuntu/tmp -Rv to fix this issue, or just delete that folder.

他のヒント

I was getting all kinds of crazy errors even after applying the fixes above, finally I ran "chmod -R 777 /home/[moi]/.npm, and it now runs without any errors.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top