博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

关于npm镜像的一些知识和命令总结

Posted on 2024-02-21 11:33  Hhuizi  阅读(44)  评论(0编辑  收藏  举报
// 查看镜像
npm config get registry


// 更换镜像
npm config set registry xxxxxx
// 恢复官方默认镜像
npm config set registry https://registry.npmjs.org
// 最新的配置淘宝镜像,原‘https://registry.npm.taobao.org’已停止服务
npm config set registry https://registry.npmmirror.com


// 清空缓存
npm cache clean --force


// 使用cnpm
npm install -g cnpm --registry=https://registry.npmmirror.com