[英]How to uninstall NPM modules from the devDependencies in node.js?
如何在 Node.js 中卸載具有 devDependencies 的npm
模塊?
使用命令:
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 rm name-of-dependency
提示:如果您忘記了名稱的拼寫方式,請檢查"devDependencies"
下的package.json
文件。
-S
標志簡單地安裝它,如下所示:
npm i -S name-of-dependency
提示:反之亦然。 要將依賴關系從package.json
文件中的“依賴項”字段移動到"devDependencies"
字段,請將-S
標志換成-D
標志。
安裝命令i
和rm
命令(也是-S
和-D
標志)當前是NPM 用來記錄刪除包和/或更改包依賴類型的過程的方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.