如果你使用 pnpm i 包名 --registry=源地址,大概率会出现以下报错
报错信息
This modules directory was created using the following registries configuration: {"default":"原来的npm源"}. The current configuration is {"default":"现在的npm源"}. To recreate the modules directory using the new settings, run "pnpm install".
我尝试了不少办法,最终使用先remove目标包,然后pnpm i下好,然后nrm切换全局源至目标包的源,再pnpm i,最后在pnpm add 包 --registry=源地址
最终安装成功