安装淘宝镜像----yarn安装以及使用----安装热部署

安装淘宝镜像

查看当前镜像源 npm config get registry

1.配置 npm 为淘宝镜像
npm config set registry https://registry.npm.taobao.org

2.安装 cnpm 为淘宝镜像

npm install -g cnpm --registry=https://registry.npm.taobao.org

如果还想使用原来的国外的镜像
npm config set registry https://registry.npmjs.org/

yarn安装以及使用

Yarn是facebook发布的一款取代npm的包管理工具。

1、安装yarn
npm i yarn -g / cnpm i yarn -g

yarn -v 如果能够打印出版本号 说明安装成功

初始化项目
yarn init // 同npm init,执行输入信息后,会生成package.json文件

下载模块包

npm i xxx / cnpm i xxx / yarn add xxx

安装热部署(supervisor nodemon)

全局安装命令:
npm i supervisor -g 或
cnpm i supervisor -g 或
yarn add supervisor -g

运行文件 nodemon + 文件名

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值