代码之家  ›  专栏  ›  技术社区  ›  Mr.D

NPM,从错误的URL地址下载依赖项

  •  0
  • Mr.D  · 技术社区  · 7 年前

    在处理某个项目后,我的npm开始从错误的全局地址下载依赖项:

    npm install -g bower
    
    npm ERR! code ETIMEDOUT
    npm ERR! errno ETIMEDOUT
    npm ERR! network request to http://172.168.1.1/bower failed, reason: 
        connect ETIMEDOUT 172.168.1.1
    npm ERR! network This is a problem related to network connectivity.
    npm ERR! network In most cases you are behind a proxy or have bad network settings.
    npm ERR! network
    npm ERR! network If you are behind a proxy, please make sure that the
    npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
    
    npm ERR! A complete log of this run can be found in:
    

    有没有办法将下载地址重置为默认地址?

    我正在使用Windows版本的NodeJS

    1 回复  |  直到 7 年前
        1
  •  8
  •   alexmac    7 年前

    看起来像你的 registry npm配置选项指向错误的位置。一定是 https://registry.npmjs.org

    npm config get registry
    

    npm config set registry https://registry.npmjs.org/
    
    推荐文章