npm命令

本地操作

npm install lodash(包名)

ls node_modules   //查看已安装的npm包

npm update   //更新本地npm包

npm outdated  //找出需要更新的包

npm uninstall lodash(包名) //卸载npm包

npm uninstall --save lodash(包名) //卸载dependencies中的npm包

npm uninstall --save-dev lodash(包名) //卸载devdependencies中的npm包

全局操作 【加上-】

npm update -g         //更新所有npm包

npm outdated -g --depth=0    //找出哪些包需要被更新

npm update -g jshint   //更新具体某个包

[sudo] npm install npm@latest -g   //更新npm本身

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容