有没有办法让npm卸载node_modules下的所有模块?像npm rebuild这样的东西可以移除所有的构建工件,但不会重建它们?
发布于 2012-07-06 18:04:59
您可以只删除node_module目录
rm -rf node_modules/
发布于 2020-07-25 05:40:47
这项工作实际上有一个特殊的命令
npm ci
它将删除node_modules
目录,并根据您的package-lock.json
文件安装软件包
发布于 2018-03-31 23:22:56
我将这个添加到我的package.json中:
"build": "npm build",
"clean": "rm -rf node_modules",
"reinstall": "npm run clean && npm install",
"rebuild": "npm run clean && npm install && npm run build",
看起来效果很好。
https://stackoverflow.com/questions/11351784
复制相似问题