安装
https://classic.yarnpkg.com/en/docs/install#windows-stable
查询与更换源
yarn config get registry
# 国内淘宝源
yarn config set registry https://registry.npm.taobao.org/
# 官方源
yarn config set registry https://registry.yarnpkg.com
使用方法:安装包
下载安装package.json下所有依赖模块:
yarn
添加一个依赖模块:
yarn add vue
npm更换源
npm也可以更换源,不过实测,更换源之后,搜索命令npm search无法使用,需要使用对应的网页搜索,要使用搜索,删除registry即可。
npm config get registry
# 国内淘宝源
npm config set registry https://registry.npm.taobao.org/
# 官方源
npm config set registry https://registry.npmjs.org
需要恢复搜索功能,请使用删除:
yarn config delete registry
npm config delete registry