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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容