Skip to content

Instantly share code, notes, and snippets.

@tomoat
Forked from hetykai/setNodeMirror.sh
Last active January 23, 2024 02:54
Show Gist options
  • Save tomoat/2b1f07bac05531a480354b1c044c2968 to your computer and use it in GitHub Desktop.
Save tomoat/2b1f07bac05531a480354b1c044c2968 to your computer and use it in GitHub Desktop.
修改node npm yarn的镜像源设置,替换为国内的淘宝源
npm set registry https://registry.npm.taobao.org && \
npm set disturl https://npm.taobao.org/dist && \
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass && \
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ && \
npm set puppeteer_download_host https://storage.googleapis.com.cnpmjs.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver && \
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs && \
npm set selenium_cdnurl https://npm.taobao.org/mirrors/selenium && \
npm set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector && \
npm set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents && \
npm set SQLITE3_BINARY_SITE https://npm.taobao.org/mirrors/sqlite3 && \
npm set node_sqlite3_binary_host_mirror https://npm.taobao.org/mirrors && \
npm set PYTHON_MIRROR https://npm.taobao.org/mirrors/python && \
npm set grpc-node-binary-host-mirror https://npm.taobao.org/mirrors/grpc && \
npm cache clean --force && \
yarn config set registry https://registry.npm.taobao.org && \
yarn config set disturl https://npm.taobao.org/dist && \
yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass && \
yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ && \
yarn config set puppeteer_download_host https://storage.googleapis.com.cnpmjs.org && \
yarn config set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
yarn config set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver && \
yarn config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs && \
yarn config set selenium_cdnurl https://npm.taobao.org/mirrors/selenium && \
yarn config set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector && \
yarn config set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents && \
yarn config set SQLITE3_BINARY_SITE https://npm.taobao.org/mirrors/sqlite3 && \
yarn config set PYTHON_MIRROR https://npm.taobao.org/mirrors/python && \
yarn config set grpc-node-binary-host-mirror https://npm.taobao.org/mirrors/grpc && \
yarn cache clean --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment