gulp 全局安装报错
在安装全局gulp时报下面的错,这个是什么原因,怎么解决的?
~ npm install -g gulp
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/gulp'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/gulp']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/gulp',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/gulp',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'Object.oncomplete (fs.js:108:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 15.6.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Users/derek
npm ERR! node -v v0.10.34
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/lib/node_modules/gulp
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/gulp'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:108:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/derek/npm-debug.log
npm ERR! not ok code
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有权限,加sudo
Please try running this command again as root/Administrator.
翻译(请你用管理员的身份运行)
sudo npm i gulp
然后输入密码 就可以了