Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
修改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 PYTHON_MIRROR https://npm.taobao.org/mirrors/python && \
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 cache clean --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment