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命令,解决

  • 相关阅读:
    在python3.x上安装suds 并访问webservice
    numpy nonzero与isnan
    彻底弄清python的切片
    pandas read_sql与read_sql_table、read_sql_query 的区别
    dataframe to sql
    同时替换掉多个字符串
    matplotlib中在for中画出多张图
    MySql 创建/删除数据库
    python3与anaconda2共存
    js调用打印机
  • 原文地址:https://www.cnblogs.com/dch0/p/11205788.html
Copyright © 2011-2022 走看看