安装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
结果可以顺利安装。
当尝试全局安装Vue-CLI时遇到errno-13权限拒绝错误,本文详细记录了错误信息,包括错误代码EACCES和系统调用access。通过使用sudo命令解决了权限问题,成功完成了Vue-CLI的安装。
2万+

被折叠的 条评论
为什么被折叠?



