安装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
结果可以顺利安装。

Logo

前往低代码交流专区

更多推荐