美文网首页
Mac安装淘宝镜像报错的一种解决方法

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

作者: 正版Figo | 来源:发表于2018-11-14 23:55 被阅读0次

    报错:

    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
    

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

    相关文章

      网友评论

          本文标题:Mac安装淘宝镜像报错的一种解决方法

          本文链接:https://www.haomeiwen.com/subject/uqxefqtx.html