gpt4 book ai didi

node.js - Dokku 在部署时将我的 Node.js 应用程序识别为 Go 应用程序

转载 作者:太空宇宙 更新时间:2023-11-04 03:10:25 25 4
gpt4 key购买 nike

我创建了 Procfile,内容如下:

web: node web.js

我的package.json:

{
"name": "app-express",
"version": "0.0.1",
"private": true,
"description": "web panel",
"main": "web.js",
"scripts": {
"start": "node web.js"
},
"dependencies": {
"async": "^0.2.10",
...
},
"engines": {
"node": "0.10.x",
"npm": "1.2.x"
},
"keywords": [
"node"
]
}

当我推送我的应用程序时,我看到:

> git push digitalocean master<br/>
Counting objects: 1207, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1141/1141), done.
Writing objects: 100% (1207/1207), 5.43 MiB | 360 KiB/s, done.
Total 1207 (delta 138), reused 0 (delta 0)
-----> Building app-express ...
Go app detected
remote: ! A .godir is required. For instructions:
remote: ! http://mmcgrana.github.io/2012/09/getting-started-with-go-on-heroku
To dokku@95.85.*.*:app-express
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku@95.85.*.*:app-express'

我做错了什么?

最佳答案

Dokku 使用 buildstep project实现对 Heroku buildpack 的支持。 GO buildpack 使用以下检测脚本:

https://github.com/kr/heroku-buildpack-go/blob/master/bin/detect

#!/usr/bin/env bash
# bin/detect <build-dir>
set -e

if test -n "$(find "$1" -type f -name '*.go' | sed 1q)"
then echo Go
else echo no; exit 1
fi

您的项目代码中是否有可能存在带有“.go”扩展名的文件?

关于node.js - Dokku 在部署时将我的 Node.js 应用程序识别为 Go 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22680057/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com