【问题标题】:How to uninstall npm modules with dev dependencies in node.js?如何在 node.js 中卸载具有开发依赖项的 npm 模块?
【发布时间】:2019-10-12 09:32:09
【问题描述】:

如何在 node.js 中卸载带有 dev 依赖的 npm 模块?

【问题讨论】:

  • 除非他正在寻找npm prune --production。也许将此作为​​第五点添加到您的列表中?
  • @Hasara,如果它解决了你的问题,你能接受我的回答吗?

标签: node.js


【解决方案1】:

使用命令:

1)npm uninstall <name of the module>

您也可以使用:

1) npm uninstall <name of the module>: 从 node_modules 中删除模块,但不是 package.json

2) npm uninstall <name of the module> --save: 也将其从 package.json 中的依赖项中删除

3) npm uninstall <name of the module> --save-dev: 也将其从 package.json 中的 devDependencies 中删除

4) npm -g uninstall <name of the module> --save: 全局删除

【讨论】:

  • 我是这个 npm 的新手,这些命令帮助我解决了我的问题。干得好!
猜你喜欢
  • 2012-10-15
  • 1970-01-01
  • 2013-10-07
  • 2021-01-17
  • 1970-01-01
  • 2019-12-13
  • 2018-10-28
  • 1970-01-01
相关资源
最近更新 更多