npm安装依赖超时

使用新系统安装NPM依赖的时候往往会出现超时的问题,包括但不限于下列错误

npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://[email protected]/adobe-webplatform/eve.git
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ailjx\AppData\Local\npm-cache\

解决方法:

# 1、 git config --global http.sslverify "false"
# 2、 git config --global url."https://".insteadOf git://
# 3、npm install --registry=https://registry.npm.taobao.org   (这个是用来替换NPM库的)

二、NPM 修改 阿里的源

阿里巴巴的npm源: http://www.npmmirror.com

# 查看本地源
npm config get registry   # 默认是:https://registry.npmjs.org/
# 改成阿里巴巴的
npm config set registry  https://registry.npmmirror.com

你可能感兴趣的:(npm安装依赖超时)