npm镜像源查看和配置

香吧香 / 2025-01-20 / 原文

转载请注明出处:

  1. 使用 npm config get registry 命令:
    npm config get registry

     显示当前配置的默认注册表地址。

  2. 使用 npm config list 命令:
    npm config list

     列出所有的 npm 配置,包括注册表设置。

  3. 使用 npm config get 命令查看特定的配置:
    npm config get registry
    npm config get proxy
    npm config get https-proxy

  4. 使用 npm info 命令:
    npm info registry

                

    显示当前使用的注册表信息。

   5. 检查 npm config edit 输出:

            运行 npm config edit 会打开一个文本编辑器,可以直接查看和编辑配置。