npm install失败

重新npm install,还报错,执行下面代码

rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install

yarn install 提示:
info There appears to be trouble with your network connection. Retrying...

1.更换淘宝镜像:
yarn config set registry https://registry.npm.taobao.org
2.删除代理:
yarn config delete proxy
npm config rm proxy
npm config rm https-proxy
3.安装cnpm设置代理
安装cnpm镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
使用代理registry
npm config set registry https://registry.npm.taobao.org

如果上述操作后还是报错,则删除yarn.lock文件,重新执行yarn install

你可能感兴趣的:(npm install失败)