user2263572
user2263572

Reputation: 5606

Excessive node modules with npm install in angular2 quickstart

Node/NPM versions:

node: v5.4.0, npm: 3.3.12

I am trying to learn Angular2 by following the quick start tutorial on the angular2 website.

Angular2 Quickstart

Here is my package.json file (exactly the same as in the tutorial).

    {
  "name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
  },
  "license": "ISC",
  "dependencies": {
    "angular2": "2.0.0-beta.0",
    "systemjs": "0.19.6",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.0",
    "zone.js": "0.5.10"
  },
  "devDependencies": {
    "concurrently": "^1.0.0",
    "lite-server": "^1.3.1",
    "typescript": "^1.7.3"
  }

When I run npm install, npm installs over 90MB of modules in the node_modules folder (A few hundred separate modules).

Should there be this many dependencies? I feel like this is excessive and something must be going wrong. Any advice or has anyone experienced similar behavior?

NPM install did not throw any errors.

The app is running fine but I wasn't able to find any information regarding all required node_modules for the app. Thanks.

Upvotes: 3

Views: 1166

Answers (1)

Winsky Wen
Winsky Wen

Reputation: 74

Actually not all of them are necessary.

For example:

"devDependencies": {
    "concurrently": "^1.0.0",
    "lite-server": "^1.3.1",
    "typescript": "^1.7.3"
}

The module of typescript can be dropped,but as I know angular2 is suggested to write code as typescript,safer and strong-typed.You can use js or coffeescript too,it is not a big deal.

The most important module is

"angular2": "2.0.0-beta.0",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",

ng2 is just under es6, so you need "es6-xxxx".

I don't think these module will take 90MB space,but the NPM always installs some same sub-modules between two modules. I don't know if this problem is handled (seems not to be).

Upvotes: 1

Related Questions