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
  • 7,766
  • 8
  • 46
  • 61
Alex Gusev
  • 1,123
  • 2
  • 12
  • 28

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,129,465
  • 480
  • 4,036
  • 4,755