从Npm中完全删除依赖项



我想从我的项目中完全删除一些依赖项,即package.json、package-lock.json包.json

{
"name": "application",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-devkit/core": "^13.3.7",
"@angular-devkit/schematics": "^13.3.7",
"@angular/animations": "^13.3.11",
"@angular/cdk": "^12.2.13",
"@angular/common": "^13.3.11",
"@angular/compiler": "^13.3.11",
"@angular/core": "^13.3.11",
"@angular/forms": "^13.3.11",
"@angular/material": "^12.2.13",
"@angular/material-moment-adapter": "^12.2.13",
"@angular/platform-browser": "^13.3.11",
"@angular/platform-browser-dynamic": "^13.3.11",
"@angular/router": "^13.3.11",

例如,我想删除@angular/forms所以我会给这个命令

npm uninstall @angular/forms

但它似乎只是从Node模块中移除我怎么能把它完全去掉呢。

Package.json在您的控制之下,您需要对其进行编辑以适应您的依赖关系。

因此,如果你想删除依赖项,这就是你的起点。

从package.json中删除它们,然后运行npm prune
您也可以删除node_modules并重新运行npm install

相关内容

  • 没有找到相关文章

最新更新