本文列举npm与yarn的常用命令
1.初始化包
npm init //npm下同
yarn init //yarn下同
2.安装包(xxx代表包名)
npm install xxx --save
yarn add xxx
3.移除包
npm uninstall xxx
yarn remove xxx
4.更新包
npm updata xxx
yarn upgrade
5.安装开发依赖的包
npm install xxx --save-dev
yarn add xxx --dev
6.全局安装
npm intall -g xxx
yarn global add xxx
7.设置下载镜像的地址
npm config set registry url
yarn config set registry url
8.安装所有依赖
npm install
yran install
9.执行包
npm run
yarn run