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类似上面的操作

你可能感兴趣的:(mac上遇到全局-g安装依赖vue-cli/dva-cli等报错问题:权限问题do not have the permissions to access this file)