npm ERR! errno ETIMEDOUTnpm ERR! network request to https://registry

 在命令行安装东西 npm i --save-dev @types/node 报错

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/npm failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
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 config set registry http://registry.npm.taobao.org/

 

你可能感兴趣的:(npm,前端,node.js)