npm 安装包出错

npm 安装包出错

错误详情

执行:npm i express 出错。
错误提示如下:

npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npm.taobao.org/expressfailed, reason: socket hang up
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!     /home/jasmine/.npm/_logs/2018-10-03T09_37_02_941Z-debug.log

大致就是说:代理服务器有问题。

解决办法:

npm config set registry https://registry.npm.taobao.org 

成功

你可能感兴趣的:(node)