我正在使用
在命令行中通过npm在全球范围内下载gulp。npm install gulp-cli --global
在Mac系统中命令。显然会弹出错误:
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access
'/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access
\'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/shendennis/.npm/_logs/2018-09-17T11_44_40_781Z-debug.log
很明显,我看到了很多使用其他程序包管理器的答复,但是有没有一种方法可以直接解决该问题而无需使用其他程序包管理器呢?