安装vue-cli的时候报错errno -13的解决办法

安装vue-cli的时候,执行命令
npm install --global @vue/cli
报错:errno -13
提示原因为不是按照管理员身份运行,请求被拒绝.
安装日志显示:

772 verbose node v10.15.3
773 verbose npm  v6.4.1
774 error path /usr/local/lib/node_modules/@vue
775 error code EACCES
776 error errno -13
777 error syscall access
778 error Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@vue'
778 error  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@vue']
778 error   stack:
778 error    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/@vue\'',
**778 error   errno: -13,**
778 error   code: 'EACCES',
778 error   syscall: 'access',
778 error   path: '/usr/local/lib/node_modules/@vue' }
779 error The operation was rejected by your operating system.
779 error It is likely you do not have the permissions to access this file as the current user
779 error
779 error If you believe this might be a permissions issue, please double-check the
779 error permissions of the file and its containing directories, or try running
779 error the command again as root/Administrator (though this is not recommended).
780 verbose exit [ -13, true ]

解决办法:使用sudo命令:
sudo npm install --global @vue/cli
结果可以顺利安装。

  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值