ERR_PNPM_META_FETCH_FAIL GET https://registry.npmjs.org/@webpack-cli%2Fserve: request to https://registry.npmjs.org/@webpack-cli%2Fserve failed, reason: Socket timeout
problem
在使用 pnpm install 和 pnpm add 时,控制台报错如下
ERR_PNPM_META_FETCH_FAIL GET https://registry.npmjs.org/@webpack-cli%2Fserve: request to https://registry.npmjs.org/@webpack-cli%2Fserve failed, reason: Socket timeout
reason
不清楚
solution
尝试1:更新pnpm版本到最细
# 先把node升级到最新 去官网去下载安装包
node -v # v16.19.1
npm -v # 8.19.3
# 升级pnpm
npm install -g pnpm@latest
pnpm -v # 8.4.0
尝试2:更新npmn源
npm config set registry https://registry.npm.taobao.org