一,npm

查看

npm get registry 

设置淘宝

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

切换默认

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

二,yarn

查看:

yarn config get registry

修改

yarn config set registry http://registry.npm.taobao.org/

设置默认

yarn config set registry https://registry.yarnpkg.com

查看yarn全局缓存目录

yarn cache dir

清除缓存

yarn cache clean

设置缓存目录

yarn config set cache-folder <path>

# example
yarn config set cache-folder 
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐