异常:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'express' ]
2 info using npm@2.7.4
3 info using node@v0.12.2
4 verbose node symlink C:\Program Files (x86)\nodejs\\node.exe
5 silly cache add args [ 'express', null ]
6 verbose cache add spec express
7 silly cache add parsed spec { raw: 'express',
7 silly cache add scope: null,
7 silly cache add name: 'express',
7 silly cache add rawSpec: '',
7 silly cache add spec: '*',
7 silly cache add type: 'range' }
8 verbose addNamed express@*
9 silly addNamed semver.valid null
10 silly addNamed semver.validRange *
11 silly addNameRange { name: 'express', range: '*', hasData: false }
12 silly mapToRegistry name express
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry uri https://registry.npmjs.org/express
16 verbose addNameRange registry:https://registry.npmjs.org/express not in flight; fetching
17 verbose request uri https://registry.npmjs.org/express
18 verbose request no auth needed
19 info attempt registry request try #1 at 09:48:35
20 verbose request id 4b1a32ff61036056
21 http request GET https://registry.npmjs.org/express
22 info retry will retry, error on last attempt: Error: connect ETIMEDOUT
23 info attempt registry request try #2 at 09:49:06
24 http request GET https://registry.npmjs.org/express
25 info retry will retry, error on last attempt: Error: connect ETIMEDOUT
26 info attempt registry request try #3 at 09:50:27
27 http request GET https://registry.npmjs.org/express
28 verbose stack Error: connect ETIMEDOUT
28 verbose stack at exports._errnoException (util.js:746:11)
28 verbose stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1000:19)
29 verbose cwd G:\zhongshiyou\ITMSFileDownLoad
30 error Windows_NT 6.3.9600
31 error argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express"
32 error node v0.12.2
33 error npm v2.7.4
34 error code ETIMEDOUT
35 error errno ETIMEDOUT
36 error syscall connect
37 error network connect ETIMEDOUT
37 error network This is most likely not a problem with npm itself
37 error network and is related to network connectivity.
37 error network In most cases you are behind a proxy or have bad network settings.
37 error network
37 error network If you are behind a proxy, please make sure that the
37 error network 'proxy' config is set properly. See: 'npm help config'
38 verbose exit [ 1, true ]

异常原因:

公司设置了上网代理,通过nmp安装express模块,代理错误

解决办法:

1,重新设置代理

http://manjeshpv.com/: npm config set proxy http://192.168.1.1:8080(代理服务器:端口)

npm config set https-proxy http://proxy-domain.com:8080 (代理服务器:端口)

2,选择http方式

npm config set registry=“http://registry.npmjs.org”//设置npm源地址

3,公司的网络可能需要验证http://www.cnblogs.com/chrischeng/archive/2013/03/22/2975235.html:

set http_proxy_user=username

set http_proxy_password=password

4,还有建议说将proxy set null

1.原npm地址

npm config set registry http://registry.npmjs.org 

2.设置国内镜像

a.通过config命令

npm config set registry https://registry.npm.taobao.org
npm info underscore (如果上面配置正确这个命令会有字符串response)

b.命令行指定

npm --registry https://registry.npm.taobao.org info underscore 

c.编辑 ~/.npmrc 加入下面内容

registry = https://registry.npm.taobao.org

3.使用nrm管理registry地址

a.下载nrm

npm install -g nrm

b.添加registry地址

nrm add npm http://registry.npmjs.org
nrm add taobao https://registry.npm.taobao.org

c.切换npm registry地址

nrm use taobao
nrm use npm

搜索镜像: https://npm.taobao.org

建立或使用镜像,参考: https://github.com/cnpm/cnpmjs.org

npm安装express 公司上网设置代理的更多相关文章

  1. 【转】npm 安装express npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE

    npm  安装 express  出现 npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATUREnpm ERR! errno UNABLE_TO_VERIFY_LEA ...

  2. 用npm安装express时报proxy的错误的解决方法

    首先要说明一点:当使用npm install <module-name>时安装组件时,安装的目录是cmd的目录+node_modules+组件名 例子如下:假如你现在安装express这个 ...

  3. win7下安装配置nodejs、使用npm安装express

    1.下载node http://nodejs.cn/download/ 这里下载自己需要的 我的环境是win764,下载地址是:https://nodejs.org/dist/v6.2.0/win-x ...

  4. npm 安装express npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE

    npm安装总是报错 报错信息: 解决方案: 在命令行输入: npm config set strict-ssl false 设置之后即可安装软件:

  5. 【转】虚拟机安装Ubuntu的上网设置(有线网络和无线网络)

    虚拟机下ubuntu共享方式上网: 一. 有线网络 在有线网络的条件下,vmware的安装非常简单,上网方式几乎不用怎么设置(默认NAT模式)    如果默认情况下不能上网,则按以下步骤尝试: *** ...

  6. 虚拟机安装Ubuntu的上网设置(有线网络和无线网络)

    (恩,是转的) 虚拟机下ubuntu共享方式上网: 一. 有线网络 在有线网络的条件下,vmware的安装非常简单,上网方式几乎不用怎么设置(默认NAT模式)     如果默认情况下不能上网,则按以下 ...

  7. virtualbox下最小化安装centos7后上网设置

    在虚拟机中以最小化方式安装centos7,后无法上网,因为centos7默认网卡未激活. 可以设置 文件 /etc/sysconfig/network-scripts/ifcfg-enp0s3 将 O ...

  8. 用npm安装express后express命令找不到

    Windows 平台加了 npm install -g express 也不行AppData\Roaming\npm 下面没有 express.bat 解决办法: sudo npm install - ...

  9. npm安装使用淘宝代理的方法(设置registry参数)

    公司防火墙问题导致 npm下载失败,安装使用cnpm不知道什么原因抽筋, 还有一个简单的办法,就是npm安装模块时,设置代理: npm install -g vue-cli --registry=ht ...

随机推荐

  1. 一个用于将sql脚本转换成实体类的js代码

    以前写过一段C#,苦于编译才能用.这样的小工具最好是用脚本语言来编写,易于执行,也易于修改. js 代码 convert.js ------------------------------------ ...

  2. struts2中文件上传

    注意点 private File image;//对应的就是表单中文件上传的那个输入域的名称,Struts2框架会封装成File类型的 private String imageFileName;// ...

  3. java集成jpush实现客户端推送

    代码地址如下:http://www.demodashi.com/demo/13700.html 前言 java 集成jpush 实现客户端推送 一.准备工作 开发环境: jdk1.6 Eclipse ...

  4. Mutex 进程间互斥

    学习Mutex的心得,不一定对,先记录一下. 同步技术分为两大类,锁定和信号同步. 锁定分为:Lock.Monitor 信号同步分为:AutoResetEvent.ManualResetEvent.S ...

  5. python selenum ---如何定位一组元素

    使用findElements方法定位一组对象 定位一组对象一般用于以下场景: · 批量操作对象,比如将页面上所有的checkbox都勾上 · 先获取一组对象,再在这组对象中过滤出需要具体定位的一些对象 ...

  6. Mac 常用的手势

    可以在触屏版-更多手势查看 技巧:前期慢慢滑动练习.一定要慢慢滑动,这样可以清楚的看出有没有产生效果,尤其注意大拇指滑动的感觉. 回到桌面:四指向外 打开Lanuchpad:四指向内 查看所有任务:三 ...

  7. NanoHttpd

    NanoHttpd是个很强大的开源库,仅仅用一个Java类,就实现了一个轻量级的 Web Server,可以非常方便地集成到Android应用中去,让你的App支持 HTTP GET, POST, P ...

  8. CENTOS 下安装APK反编译工具 APKTOOL

    转于:http://www.qiansw.com/centos-apk-apktool.html 我使用的是CentOS6.4 64位的系统.首先需要下载两个包.这里下载:https://code.g ...

  9. 两DD-WRT组建WDS设置

    今天把买了非常久的两台CISCO(已刷DD-WRT)路由器组成WDS,參考了三篇文章   DD-WRT v24-sp2的WDS中继设置 http://www.cnblogs.com/zjoch/arc ...

  10. linux系统的开机引导、启动流程

    固件(CMOS/BIOS) > POST 加电自检 ↓ 自举程序(GRUB)> 加载内核 ↓ 载入内核 > 驱动硬件 ↓ 启动进程 init ↓ 读取执行配置文件/etc/initt ...