Alex Gusev Alex Gusev - 1 year ago 103
Git Question

npm: install module with repo data

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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download