npm与yarn安装包

1. npm安装

全局安装

npm install 包名 -g

本地安装

npm install 包名 --save-dev // 本地安装开发环境的包
npm install 包名 --save // 本地安装所有包
npm install 包名@版本号

2.npm更新包

全局更新

npm update 包名@版本号 -g // 全局更新包,不加版本号默认更新到最新,也可以用@latest的方式更新到最新

本地更新

npm update 包名 //更新到最新

3.npm卸载包

全局卸载

npm uninstall -g

本地卸载

npm uninstall -S // 卸载生产环境的包
npm uninstall -D // 卸载开发环境的发

更多指令见npm中文网

posted @ 2020-03-18 23:52  Barry东东和西西  阅读(872)  评论(0)    收藏  举报