Terminal 如何解决在终端中安装gulp时出现的错误“ERR!Error:EACCES:permission denied,symlink…”?

Terminal 如何解决在终端中安装gulp时出现的错误“ERR!Error:EACCES:permission denied,symlink…”?,terminal,gulp,gulp-install,Terminal,Gulp,Gulp Install,我正在尝试在全球范围内安装gulp。一开始我遇到问题,所以我将文件的所有者从根用户更改为我的用户。 但我知道我遇到了这个错误,老实说,这是我第一次使用终端安装功能。我将非常感谢你的帮助。谢谢 Anthonys-MacBook-Pro:~ anthonyarguello$ npm install --g gulp-cli npm ERR! path ../lib/node_modules/gulp-cli/bin/gulp.js npm ERR! code EACCES npm ERR! errn

我正在尝试在全球范围内安装gulp。一开始我遇到问题,所以我将文件的所有者从根用户更改为我的用户。 但我知道我遇到了这个错误,老实说,这是我第一次使用终端安装功能。我将非常感谢你的帮助。谢谢

Anthonys-MacBook-Pro:~ anthonyarguello$ npm install --g gulp-cli
npm ERR! path ../lib/node_modules/gulp-cli/bin/gulp.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/gulp-cli/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR!  { [Error: EACCES: permission denied, symlink '../lib/node_modules/gulp-cli/bin/gulp.js' -> '/usr/local/bin/gulp']
npm ERR!   cause:
npm ERR!    { Error: EACCES: permission denied, symlink '../lib/node_modules/gulp-cli/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'symlink',
npm ERR!      path: '../lib/node_modules/gulp-cli/bin/gulp.js',
npm ERR!      dest: '/usr/local/bin/gulp' },
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, symlink \'../lib/node_modules/gulp-cli/bin/gulp.js\' -> \'/usr/local/bin/gulp\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/gulp-cli/bin/gulp.js',
npm ERR!   dest: '/usr/local/bin/gulp' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/anthonyarguello/.npm/_logs/2019-06-30T00_38_52_813Z-debug.log

大口喝

试试看: sudo npm安装-g gulp cli

尝试: sudo npm安装-g gulp cli

sudo npm安装-g gulp cli//-g带单仪表板sudo npm安装-g gulp cli//-g带单仪表板