問題筆記:關于mac上遇到安裝依賴需要權限問題
解決辦法:在安裝命令前加上 sudo,安裝然后輸入密碼

報錯信息
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.
提示 操作被拒絕,沒有權限
解決辦法
- 把安裝vue-cli命令改為
sudo npm install -g @vue/cli -
輸入自己電腦密碼,密碼為不可見的。
密碼輸入界面
然后就安裝成功了!
同理遇到其他安裝錯誤 提示為權限問題可以在命令前面加上 sudo類似上面的操作
