0

I am trying to open an existing angular 4 application to upgrade to angular 6 application.

the project structure is as follows:

-Core
----src
--------components
--------assets
--------pipes
--------package.json
--------index.ts
package.json
gulpfile.js
tsconfig.json

In the above structure, there is a package.json in both the root and inside src folder. I am not sure whether i can delete the one inside \src folder? From going through the code i can understand that this project is made as a module which is then linked to the main application using symbolic links.

Can anyone tell what is the use of multiple package.json here?

package.json inside src folder:

{
  "name": "core",
  "version": "0.1.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/username/repo"
  },
  "author": {
    "name": "name",
    "email": "name@email.com"
  },
  "keywords": [
    "angular"
  ],
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/username/repo/issues"
  },
  "main": "index.umd.js",
  "module": "index.js",
  "jsnext:main": "index.js",
  "typings": "index.d.ts",
  "peerDependencies": {
    "@angular/common": "^4.2.0",
    "@angular/core": "^4.2.0",
    "@angular/forms": "^4.3.6",
    "@angular/http": "^4.3.6",
    "@angular/router": "^4.3.6",
    "angular-in-memory-web-api": "^0.5.1",
    "d3": "^4.10.2",
    "primeng": "^4.1.0",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  }
}

Thanks

Mukil Deepthi
  • 6,072
  • 13
  • 71
  • 156
  • Don't think you need two, even if it's a component library should be with the main one. Unless I could see that the parent package.json is more for backend and project build etc, and the src one is specifically for front-end libs. – Taranjit Kang Oct 17 '18 at 13:18

1 Answers1

0

npm will go through all the sub folders and run npm install. So basically if you run the package.json in the root directory, it will run the package.json inside sub directory as well.

The best way to run npm install for nested folders?

Arun
  • 3,701
  • 5
  • 32
  • 43