Aric Aric - 1 month ago 5
Node.js Question

NPM Custom URL Module From Beanstalk

I'm trying to set a dependency in a package.json file to a remote beanstalk repository to have it included in a project.

Currently it's setup as the following:

{
"name": "SOME_NAME",
"version": "0.0.1",
"private": true,
"dependencies": {
"SOME_MODULE_NAME" : "git@xxx.beanstalkapp.com:/xxx.git#v0.0.1"
}
}


This however returns the following npm error:

npm WARN package.json SOME_NAME@0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/SOME_MODULE_NAME
npm http 404 https://registry.npmjs.org/SOME_MODULE_NAME
npm ERR! 404 'SOME_MODULE_NAME' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.


It seems to bypass the beanstalk url and falls back to finding a module within the global repo. Any thoughts / suggestions?

I've also tried utilizing the git+ssh:// style url to no avail.

Thanks!

Answer

See "Git URLs as Dependencies":

Git urls can be of the form:

git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+ssh://user@hostname/project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish

The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. The default is master.

Your url should be:

"git://xxx.beanstalkapp.com/xxx.git#v0.0.1"
Comments