美文网首页
清除node本地缓存后cnpm损坏

清除node本地缓存后cnpm损坏

作者: winterchao | 来源:发表于2023-01-27 10:03 被阅读0次

    执行

    npm cache clear --force
    

    发现cnpm命令没有反应,cnpm -v 报错

    cnpm : 无法将“cnpm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    所在位置 行:1 字符: 1
    + cnpm -v
    + ~~~~
        + CategoryInfo          : ObjectNotFound: (cnpm:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    

    修复办法:

    npm uninstall -g cnpm --registry=https://registry.npm.taobao.org
    npm set registry https://registry.npm.taobao.org
    npm set disturl https://npm.taobao.org/dist
    npm install -g cnpm --registry=https://registry.npm.taobao.org
    

    相关文章

      网友评论

          本文标题:清除node本地缓存后cnpm损坏

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