0
即時通訊使用Angular和ngx-bootstrap但我在node_modules內有269個文件夾。當然,並非所有這些都是必要的?有沒有辦法確定這些文件夾中是否有一些不再需要? node_modules文件夾超過88MB!我可能在最近幾天安裝了一些其他軟件包,但我不記得,因爲我還必須手動調整我的package.json文件。如何判斷我是否真的需要下載的節點包數量?
這裏是我的package.json
{
"author": "me",
"dependencies": {
"@angular/cdk": "^2.0.0-beta.8",
"@angular/common": "~4.3.0",
"@angular/compiler": "~4.3.0",
"@angular/core": "~4.3.0",
"@angular/forms": "~4.3.0",
"@angular/http": "~4.3.0",
"@angular/platform-browser": "~4.3.0",
"@angular/platform-browser-dynamic": "~4.3.0",
"@angular/router": "~4.3.0",
"angular-in-memory-web-api": "~0.2.4",
"core-js": "^2.5.0",
"moment": "^2.18.1",
"moment-timezone-all": "^0.5.5",
"rxjs": "5.0.1",
"systemjs": "0.19.40",
"zone.js": "^0.8.4"
},
"description": "A starter app using Angular2, Bootstrap CSS for hosting within an ASP.NET MVC web app",
"devDependencies": {
"@types/node": "^6.0.85",
"alertify.js": "^1.0.12",
"bootstrap": "^3.3.7",
"font-awesome": "^4.7.0",
"jquery": "^3.2.1",
"modernizr": "^3.5.0",
"ngx-bootstrap": "^1.8.1",
"systemjs": "^0.19.40"
},
"keywords": [],
"license": "MIT",
"name": "aspng2",
"repository": {},
"version": "1.0.0"
}
你可以試試'NPM prune'(見https://stackoverflow.com/questions/21417014/npm-command-to-uninstall-unused-packages-in -node-js),但現實情況是,像Angular這樣的框架是巨大的,現在JavaScript生態系統非常龐大,所以很可能你根本無法節省空間。 –
^這應該是答案。 'npm prune'。 '269'看起來不太奇怪,因爲NPM 3及更高版本具有普通的目錄結構。對於Angular項目,88MB被認爲是小型的。 – estus