zoukankan      html  css  js  c++  java
  • centos npm install 超时报错

    使用npm install 时报错

    [root@localhost helloworld]# npm install forever -g
    npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
    npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
    npm ERR! code ENOTFOUND
    npm ERR! errno ENOTFOUND
    npm ERR! network request to https://registry.npmjs.org/forever-monitor failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
    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:
    npm ERR!     /root/.npm/_logs/2019-07-12T21_28_34_755Z-debug.log
    
    

    查看npm源地址

    npm config get registry
    
    #http://registry.npmjs.org 为国外镜像地址
    
    • 设置阿里云镜像
    npm config set registry http://registry.npm.taobao.org
    
    #如果不能解决
    npm install -g cnpm --registry=https://registry.npm.taobao.org
    

    重新运行npm命令,解决

  • 相关阅读:
    C#随机数的使用
    英才评测 个人性格倾向 IT知识
    有点迷茫
    [转帖]2006年it人士必去的10个网站
    ASP.NET 中 Cookie 的基本知识
    Http请求方法
    Spherical Mercator
    Axure快速原型设计
    【转】Spring Insight 使用介绍
    DB2执行sql文件
  • 原文地址:https://www.cnblogs.com/dch0/p/11205788.html
Copyright © 2011-2022 走看看