mac上遇到全局-g安裝依賴vue-cli/dva-cli等報錯問題:權限問題do not have the permissions to access this file

問題筆記:關于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.

提示 操作被拒絕,沒有權限

解決辦法

  1. 把安裝vue-cli命令改為sudo npm install -g @vue/cli
  2. 輸入自己電腦密碼,密碼為不可見的。


    密碼輸入界面

    然后就安裝成功了!

同理遇到其他安裝錯誤 提示為權限問題可以在命令前面加上 sudo類似上面的操作

最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容