0

我正在尝试将 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:// 样式的 url 无济于事。

谢谢!

4

1 回答 1

1

请参阅“作为依赖项的 Git URL

Git url 可以是以下形式:

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 可以是任何可以作为参数提供给 git checkout 的标记、sha 或分支。默认是主。

你的网址应该是:

"git://xxx.beanstalkapp.com/xxx.git#v0.0.1"
于 2012-07-27T23:12:52.480 回答