在国内用npm install时,速度总是不尽如人意,解决办法是修改npm的数据源

npm config set registry https://registry.npm.taobao.org

修改后可以通过这个进行测试

npm config get registry

如果更改好了之后提示错误。

Nothing to stop. No server is running for the store at /root/.pnpm-store/v3
 ERROR  This modules directory was created using the following registries configuration: {"default":"https://registry.npm.taobao.org/"}. The current configuration is {"default":"https://registry.npmjs.org/"}. To recreate the modules directory using the new settings, run "pnpm install"

解决办法:运行

pnpm install -g