npm 和yarn都是js包管理工具
npm命令
npm install
npm run dev
yarn命令
yarn
yarn start 或者 yarn serve
Yarn和npm命令对比
npm | yarn |
---|---|
npm install | yarn |
npm install react --save | yarn add react |
npm uninstall react --save | yarn remove react |
npm install react --save-dev | yarn add react --dev |
npm update --save | yarn upgrade |
npm查看修改镜像
1 查看镜像 npm config get registry
2 设置npm的源,设置多个只有一个会生效
//设置淘宝源
npm config set registry https://registry.npm.taobao.org
或者直接修改配置文件 .npmrc
//淘宝源
registry = https://registry.npm.taobao.org