Install package.json dependency from git, not npm


#1

I’m trying to install gitkit but it depends on a fork of dissolve, which is only on github, not on npm. https://github.com/SamyPesse/gitkit-js/issues/6

npm on HyperDev can’t install it becuase it doesn’t have a command line git installed. Can this be fixed?

This would also allow installing custom packages by adding things like:

	"node-wirc": "git://github.com/rjmunro/node-wirc#master"

to dependencies, which would be a really useful way to test and demonstrate changes you have made to the package before making a pull request to the original author.


#2

Thanks for the report! We’ll look into fixing it and will update this thread when it’s released.


#3

I know this is a year old, but I thought I would put this here in case anyone ran into this ticket and thought it was still an issue.

I was able to install a custom package inside my package.json by using

"botkit-storage-mongo": "git+https://github.com/dakotasmith/botkit-storage-mongo.git#update-monk"

So I’d say it’s fixed!


#4

I think using git urls is not working at this point. I can add it to the package.json and the log says things were installed but the module fails to resolve.

Using the console and navigating to node_modules I can see that the git-based dependency is not there. If I manually run npm install the dependency seems to be downloaded correctly.

Edit: And adding a new dependency seems to cause the downloaded git repo to vanish, I have to manually run npm install again.

Edit 2: Changed my start command to "start": "npm install && node server.js" as a workaround


#5

Preety much its the issue the node or npm version.
As I had some similar issue earlier, but when I downgraded my node version it happened to get fixed.
I hope that helps ya out.


#6

@Froosty is right, there is a bug with the latest npm versions that makes npm prune not work correctly with git-based dependencies. After the install step, we always run an npm prune to free up some space.

We are working on a possible solution for the issue, we’ll keep you posted :slight_smile: In the meantime, the workaround proposed by @Froosty should work!


#7

Good news! We just deployed a change that should fix this issue for every node version.

Let us know if the problem is actually solved :slight_smile:

cc: @Froosty


#8

Its an Awesome news.


#9

Looks like it is working for me! Thank you @etamponi