包管理工具-npm

来源:互联网 发布:浪潮软件股票 编辑:程序博客网 时间:2024/05/22 15:12

本地操作

1.安装npm包

npm install lodash(包名)

2.查看已安装的npm包

ls node_modules

3.更新本地npm包

npm update

4.找出需要更新的包

npm outdated

5.卸载npm包

npm uninstall lodash(包名)

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

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

全局操作 【加上-g】

1.更新所有npm包

npm update -g

2.找出哪些包需要被更新

npm outdated -g –depth=0

3.更新具体某个包

npm update -g jshint

4.更新npm本身

[sudo] npm install npm@latest -g

原创粉丝点击