Last active
October 7, 2024 06:03
-
-
Save 52cik/c1de8926e20971f415dd to your computer and use it in GitHub Desktop.
npm 淘宝镜像配置
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm set registry https://r.npm.taobao.org # 注册模块镜像 | |
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 | |
## 以下选择添加 | |
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像 | |
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像 | |
npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像 | |
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像 | |
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像 | |
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像 | |
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs 二进制包镜像 | |
npm set selenium_cdnurl https://npm.taobao.org/mirrors/selenium # selenium 二进制包镜像 | |
npm set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector # node-inspector 二进制包镜像 | |
npm cache clean --force # 清空缓存 |
npm cache verify
没用的
使用 npm set registry https://r.npm.taobao.org 会更加快。
使用 npm set registry https://r.npm.taobao.org 会更加快。
@fengmk2 什么道理?
npm config set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron7+ 二进制包镜像
原来的设置在 Electron7 会碰到失败的问题,改成如上网址可以解决。
npm set ELECTRON_MIRROR https://npm.taobao.org/mirrors/electron/
如果同时需要发布 npm package需要怎么设置registry?我理解taobao的镜像是只读的。官方源与taobao源切换?
使用 npm set registry https://r.npm.taobao.org 会更加快。
ping
了一下,发现两者是同一个 IP 哦
我看淘宝 npm 镜像官网和示例地址修改为了 registry.npmmirror.com,是否需要同步修改呢?官网:https://npmmirror.com/
+1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用
npm cache verify
会不会更好一点?