巴拉巴拉
小魔仙

OSX安装npm全局包有权限问题

安装npm全局包的权限问题

localhost:~ jecced$ npm install -g typescript
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/jecced/.npm/_logs/2018-08-08T01_45_35_346Z-debug.log

 

解决方法:

修改npm包所安装目录的权限:sudo chown -R $USER /usr/local   然后输入密码就可以了

赞(0) 打赏
如果文章对你有帮助,欢迎你来评价反馈。AgainFly » OSX安装npm全局包有权限问题

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  • Q Q(选填)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏