npm

311 阅读1分钟

清除 npm 仓库源

npm config rm registry

清空npm 缓存

npm cache clean --force

yarn cache clean

设置淘宝镜像

修改

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

通过 npm config get registry 查看是否设置成功

还原

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

通过使用cnpm安装

npm install -g cnpm --registry=https://registry.npm.taobao.org

使用cnpm,cnpm install xxx