Mac安装淘宝镜像报错的一种解决方法

2018-11-14  本文已影响0人  正版Figo

报错:

The operation was rejected by your operating system.
//操作被您的操作系统拒绝。
It is likely you do not have the permissions to access this file as the current user
//您可能没有权限作为当前用户访问此文件。
If you believe this might be a permissions issue, please double-check the
//如果您认为这可能是权限问题,请重新检查
permissions of the file and its containing directories, or try running
//文件及其包含目录的权限,或者尝试运行
npm ERR! the command again as root/Administrator (though this is not recommended).
//命令再次作为根/管理员(虽然这是不推荐的)。

解决:

sudo npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose

此时会提示让你输入一个密码,即你的用户开机密码,输入回车即可,(看不见你输入的内容也没关系)如果出现下面的信息(最下面几行)说明安装成功:
……

added 692 packages in 29.865s

npm verb exit [ 0, true ]

npm info ok

查看命令:

cnpm -v

==============
过程中遇见最多的错误是:权限
很无语

上一篇下一篇

猜你喜欢

热点阅读