npm install pnpm -g :request to https://registry.npmjs.org/pnpm failed, reason: connect ETIMEDOUT

 npm install pnpm -g 安装初始化vite vue3项目

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/pnpm failed, reason: connect ETIMEDOUT 104.16.29.34:443
 

   在使用  npm cache clean --force  命令时报的错。

        可以使用  npm cache verify  命令。

也没有用

修改镜像

//1.查看npm镜像设置
npm config get registry
//2.将npm设置为淘宝镜像
npm config set registry https://registry.npm.taobao.org
//3.再次查看npm镜像设置
npm config get registry
 

 再重新执行:

npm i -g pnpm

猜你喜欢

转载自blog.csdn.net/LlanyW/article/details/134988898