git - 如何在 heroku 上的 package.json 中将 public bitbucket repo 引用为 npm 模块?

标签 git heroku npm bitbucket

我在 packages.json 中尝试了 {myrepo}: git://git@bitbucket.org/{myaccount}/{myrepo}.git。在我的本地计算机上,当我键入 sudo npm install(我必须使用 sudo)时,它可以正常工作并且我的 repo 被克隆到 node_modules。

当我将我的应用程序推送到 heroku 时出现错误:

       npm ERR! git clone git://git@bitbucket.org/{myaccount}/{myrepo}.git Initialized empty Git repository in /app/.npm/_git-remotes/git-git-bitbucket-org-{myaccount}-{myrepo}-git-bd17f867/
       npm ERR! git clone git://git@bitbucket.org/{myaccount}/{myrepo}.git 
       npm ERR! git clone git://git@bitbucket.org/{myaccount}/{myrepo}.git fatal: Unable to look up git@bitbucket.org (Unknown host)
       npm ERR! Error: Command failed: fatal: Unable to look up git@bitbucket.org (Unknown host)
       npm ERR! 
       npm ERR!     at ChildProcess.exithandler (child_process.js:637:15)
       npm ERR!     at ChildProcess.EventEmitter.emit (events.js:98:17)
       npm ERR!     at maybeClose (child_process.js:743:16)
       npm ERR!     at Socket.<anonymous> (child_process.js:956:11)
       npm ERR!     at Socket.EventEmitter.emit (events.js:95:17)
       npm ERR!     at Pipe.close (net.js:465:12)
       npm ERR! If you need help, you may report this *entire* log,
       npm ERR! including the npm and node versions, at:
       npm ERR!     <http://github.com/npm/npm/issues>

这是公开的 repo 。 我做错了什么?

最佳答案

尝试使用 git+https://bitbucket.org/{user}/{repo}.git 代替。

或者 git+ssh://git@bitbucket.org/{user}/{repo}.git 如果你想通过 ssh 获取它,但我不推荐它,因为它需要授权。

关于git - 如何在 heroku 上的 package.json 中将 public bitbucket repo 引用为 npm 模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22756882/

相关文章:

git - 过滤掉 SourceTree 中的作者

ruby - 用 1 个 dyno 保持 Heroku 清醒的最佳方法

node.js - Visual Studio NodeJS 工具 - 如何打包项目?创建 NPM?

git - git 中的原始分支是什么?如何使用它?

Xcode 9 : Multiple Working Copies Git

git - 发送带有未提交更改的 git 存储库的最佳方式?

angularjs - 如何在我的 Angular 应用程序中安装 underscore.js?

heroku 抛出错误,但没有告诉我错误位于 : Invalid numeric literal at line 31, 第 7 列中的哪个文件

node.js - 使用node.js在云(heroku)上读取/写入文件

node.js - 无法安装 Node.js 包