選擇依賴管理工具NPM
準備工作
使用前,請確保您已經(jīng)安裝node.js(或io.js)和npm,如果您尚未安裝,請點擊此處加速下載安裝。
使用說明
NPM的配置文件為用戶根目錄下的:~/.npmrc(Windows路徑為:C:Users<UserName>.npmrc),您可以點擊此處直接下載配置文件,或者運行如下命令設置:
npm config set registry https://repo.huaweicloud.com/repository/npm/ npm cache clean-f
華為開源 鏡像 站同時也提供了工具類加速鏡像,可以通過如下的命令設置加速地址:
※設置nodejs工具的鏡像地址
npm config set disturl https://repo.huaweicloud.com/nodejs
※設置Node-Sass的鏡像地址
npm config set sass_binary_site https://repo.huaweicloud.com/node-sass
※設置瀏覽器引擎驅(qū)動鏡像地址,如果需要安裝Selenium,請點擊此處
npm config set phantomjs_cdnurl https://repo.huaweicloud.com/phantomjs npm config set chromedriver_cdnurl https://repo.huaweicloud.com/chromedriver npm config set operadriver_cdnurl https://repo.huaweicloud.com/operadriver
※設置Electron和Python的鏡像地址
npm config set electron_mirror https://repo.huaweicloud.com/electron/ npm config set python_mirror https://repo.huaweicloud.com/python
選擇依賴管理工具Yarn
準備工作
使用前,請確保您已經(jīng)安裝Node.js和yarn。如果您尚未安裝,可以點擊下面鏈接加速下載安裝:
Node.js加速下載地址:https://repo.huaweicloud.com/nodejs/
yarn加速下載地址:https://repo.huaweicloud.com/yarn/
使用說明
yarn的配置文件為用戶根目錄下的:~/.yarnrc(Windows路徑為:C:Users<UserName>.yarnrc),可執(zhí)行如下命令設置鏡像源:
yarn config set registry https://repo.huaweicloud.com/repository/npm/