0

I have been using git / forking / branching / pull requests and npm for a while now for standard nodejs work and have not much issue. However, when I attempt to Fork an Angular repo and install this forked version in my project I get different content in the node_modules folder.

The original repo - angular2-tree-diagram - https://github.com/artbelikov/angular2-tree-diagram.git

The forked version - thxmike/angular2-tree-diagram - https://github.com/thxmike/angular2-tree-diagram.git

I install the original repo with the following command:

npm install angular2-tree-diagram --save

This installs the content from the src/ directory

However if I install my Forked verion using the following command:

npm install thxmike/angular2-tree-diagram --save

This install the entire repo

The angular.json, tsconfig.app and package.json are almost identical as far as pathing so I am confused on why the differences in the installation.

I have tried a few different changes such as what is documented here: npm install and build of forked github repo but I have not had much success.

I am not sure if this is something specific with Angular or I am just missing a detail that I can't see.

Any assistance in this matter would be appreciated.

thxmike
  • 614
  • 1
  • 7
  • 25

1 Answers1

1

After more digging, thinking through the process and a little common sense, I found that the issue lies how the original project was registered and published to npm.

Even though the original source code lives in Github, the registration/publication of the project was done from the separate /src directory. So it only included files from this direct. This means whenever I ran the following command:

npm install angular2-tree-diagram --save

This was pulling down the zip file from the npm registry and laying out the files from the /src directory, that were inside of the npm package.

Even though I forked the project, I did not have a corresponding registration/publication in npm to pull down, so when I ran the following command:

npm install thxmike/angular2-tree-diagram --save

It was pulling it directly from the forked repo (i.e. thxmike/) and pulling down all the files I had specified in the repo.

I should have seen this earlier. Hopefully someone else can benefit from this obvious oversight.

thxmike
  • 614
  • 1
  • 7
  • 25