我正在尝试将package.json文件中的依赖项设置为远程beanstalk存储库,以使其包含在项目中。
目前设置如下:
{
"name": "SOME_NAME",
"version": "0.0.1",
"private": true,
"dependencies": {
"SOME_MODULE_NAME" : "git@xxx.beanstalkapp.com:/xxx.git#v0.0.1"
}
}
然而,这会返回以下npm错误:
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.
它似乎绕过了beanstalk url并回退到在全局repo中找到一个模块。有什么想法/建议吗?
我也尝试过使用git + ssh:// style url无济于事。
谢谢!
答案 0 :(得分:1)
请参阅“Git URLs as Dependencies”:
Git网址可以是以下形式:
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
commit-ish可以是任何标记,sha或分支,可以作为git checkout的参数提供。默认值为master。
你的网址应该是:
"git://xxx.beanstalkapp.com/xxx.git#v0.0.1"