华为云计算 云知识 依赖管理工具如何配置

依赖管理工具如何配置

选择依赖管理工具NPM

准备工作

使用前,请确保您已经安装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

※设置浏览器引擎驱动镜像地址,如果需要安装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

准备工作

使用前,请确保您已经安装Node.js和yarn。如果您尚未安装,可以点击下面链接加速下载安装:

Node.js加速下载地址:https://repo.huaweicloud.com/nodejs/

yarn加速下载地址:https://repo.huaweicloud.com/yarn/

使用说明

yarn的配置文件为用户根目录下的:~/.yarnrc(Windows路径为:C:Users<UserName>.yarnrc),可执行如下命令设置镜像源:

yarn config set registry https://repo.huaweicloud.com/repository/npm/

 

上一篇:什么是MPFR 下一篇:云迁移有哪些主要类别?