我按照说明操作:http://learnsemantic.com/guide/expert.html
我到了应该运行此命令的地步:
npm install -g gulp
我得到以下结果:
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.19.0-16-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /home/yannick
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules
npm ERR! fstream_path /usr/local/lib/node_modules/gulp
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules'
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/yannick/npm-debug.log
npm ERR! not ok code 0
谁能告诉我我做错了什么?
答案 0 :(得分:1)
解决!答案可以在这里找到:https://github.com/joyent/node/issues/3911#issuecomment-8956154
:)
答案 1 :(得分:0)
关键是第3行,
npm ERR!请尝试以root / Administrator方式再次运行此命令。
尝试以sudo
用户身份运行命令,或者更好地确保您可以全局安装npm模块而无需sudo命令。我上次使用的指南可以在这里找到:https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md