1

How can I install github project into ./node_modules/ so that ./node_modules/project folder will contain .git subfolder?

I have tried:

 npm install git+https://github.com/user/project

but .git/ subfolder was missed in the target ./node_modules/project/ folder.

Probably there is some other way to develop other modules (from other repos) from main application?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Alex Gusev
  • 1,526
  • 3
  • 16
  • 35

1 Answers1

1

If you really need it, you could add the .git folder after the npm installation:

cd ./node_modules/project/
git clone --bare https://github.com/user/project .git
cd .git
git config --local --bool core.bare false

That is using a bare clone that you transform into a regular repo.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250