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 命令失败后,导致产生的错误日志文件放在错误的目录下,或者是其他调用引起?未证实。

  • 相关阅读:
    Sum Root to Leaf Numbers
    Sum Root to Leaf Numbers
    Sort Colors
    Partition List
    Binary Tree Inorder Traversal
    Binary Tree Postorder Traversal
    Remove Duplicates from Sorted List II
    Remove Duplicates from Sorted List
    Search a 2D Matrix
    leetcode221
  • 原文地址:https://www.cnblogs.com/BlackStorm/p/6379504.html
Copyright © 2011-2022 走看看