背景:
由于换电脑需要将开发环境重新安装一遍,再安装vue脚手架时,总是报错npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
大致意思就是说 当前用户的权限不够
于是需要切换到root权限,在这之前 自己了解过Linux的用户切换命令 sudo ,所以一直沿用了Linux中的语法,在mac中切换到root 权限的命令为 sudo su -
总结:
1.安装vue-cli需要root权限 不然会一直报错
2.知识是灵活变通的。
在更换电脑并重新安装开发环境时,遇到在macOS上安装vue-cli时因权限不足导致的npm错误。解决方法是使用`sudo su -`命令切换到root权限。理解不同操作系统中权限管理的差异对于顺利进行软件安装至关重要。
1万+

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



