【问题标题】:NPM Custom URL Module From Beanstalk来自 Beanstalk 的 NPM 自定义 URL 模块
【发布时间】:2016-10-11 06:22:59
【问题描述】:

我正在尝试将 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,但无济于事。

谢谢!

【问题讨论】:

    标签: node.js package npm


    【解决方案1】:

    见“Git URLs as Dependencies

    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 或分支。默认是master。

    你的网址应该是:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 2012-08-30
      • 2019-08-06
      • 1970-01-01
      • 1970-01-01
      • 2012-08-29
      • 2016-05-10
      相关资源
      最近更新 更多