zoukankan      html  css  js  c++  java
  • npm 全局执行 update 、 outdated 出现 npm-debug.log 404 错误的问题

    想要执行一次全局更新,发现屡次报错:

    # npm update -g
    

    提示的错误信息包含如下内容:

    npm ERR! code E404
    npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/npm-debug.log
    

    寻找解决方案未果。后来看到一个不相关的回答: npm cache clean ,脑洞大开想到可能是 npm 的 modules 文件夹下多出了一个 npm-debug.log 的文件,导致查询仓库时把这个文件名也拿去查询了。 locate 一下发现果真如此:

    $ locate npm-debug.log
    
    /home/xxxxxx/npm-debug.log
    /usr/lib/node_modules/npm-debug.log
    

    把在系统目录下的这个 npm-debug.log 文件删掉后,再次执行全局的 update 或 outdated 命令,一切恢复正常。

    猜测有可能是某次用了 root 用户执行 npm 命令失败后,导致产生的错误日志文件放在错误的目录下,或者是其他调用引起?未证实。

  • 相关阅读:
    CocoaPods
    第一篇 理论 1.7 精进-正念-正知,如理作意和觉察力
    构架稳定与可扩展的优惠券系统
    一个产品从0到1的过程
    实现实时定位
    征信比拼重点是数据和连接
    黑产
    爬虫有什么用
    爬虫应用
    甘蔗理论
  • 原文地址:https://www.cnblogs.com/BlackStorm/p/6379504.html
Copyright © 2011-2022 走看看