npm | yarn | 注释 |
---|---|---|
npm init | yarn init | 初始化项目 |
npm install | yarn | 安装全部依赖 |
npm install react –save | yarn add react | 安装某个依赖,保存到 dependencies |
npm uninstall react –save | yarn remove react | 移除某个依赖 |
npm install react –save-dev | yarn add react –dev | 安装某依赖,保存到 devDependencies |
npm update [package] –save | yarn upgrade [package] | 更新生产环境某个依赖包 |
npm install axios –global | yarn global add axios | 全局安装某个依赖 |
npm install –save axios vue-axios | yarn add axios vue-axios | 同时下载多个依赖包 |
npm install [package]@[version] | yarn add [package]@[version] | 安装指定版本的包 |
npm rebuild | yarn install –force | 重新下载所有包 |
原文出处:http://www.dongblog.com/notes/45.html
来源:博客网 转载请注明出处!