如何卸载本地npm包

要卸载包,请使用

npm uninstall < package >:

> npm uninstall jquery

这样jquery包便会从node_modules中移除,并且会从package.json中移除相应条目

使用dir命令,确认包是否被删除

dir命令会列出指定目录下所有目录,所以可用于确认包是否安装、卸载

例: 安装

> npm install bootstrap
> dir node_modules  
bootstrap #说明bootstrap已安装

卸载

> npm uninstall bootstrap
> dir node_modules
空 #说明bootstrap已卸载

results matching ""

    No results matching ""