Hello, I’m trying to run Node.js app on Fly.io.
I receive this error: “error Command “start” not found”
In my boilerplate I have packages/client “yarn run start” and packages/server “yarn dev”.
How to specify it for fly.io?
Hello, I’m trying to run Node.js app on Fly.io.
I receive this error: “error Command “start” not found”
In my boilerplate I have packages/client “yarn run start” and packages/server “yarn dev”.
How to specify it for fly.io?
Can you share more information about this boilerplate? Did this come from some sort of framework?
I’m guessing that during development you start the client and run the server in dev mode, but for production you build the client and start the server?
If I can get more information I can be more helpful.
So, now I get this error.
[Error: Yarn install error]
Yarn install error: Yarn command finished with a non-zero exit code: exit status: 1
ERROR: failed to build: exit status 1
Error: failed to fetch an image or build from source: executing lifecycle: failed with status code: 51
Here is my fly.toml
# fly.toml app configuration file generated for summer-cloud-9028 on 2023-05-11T14:52:41+02:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = "[hidden]"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
builder = "heroku/buildpacks:20"
[env]
NODE_ENV = "production"
PORT = "8080"
# The following ENVs are not listed here because they are registered as secrets:
# MYSQL_HOST
# MYSQL_PORT
# MYSQL_DATABASE
# MYSQL_USER
# MYSQL_PASSWORD
[deploy]
release_command = "yarn knex migrate:latest"
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
Try adding --legacy-peer-deps
to the line(s) in your Dockerfile that RUN yarn install
.
Ok! But, seems I deleted Dockerfile, how to reinstall it?
Seems the buildpack takes care of that - so I don’t need Dockerfile with this setup…
Now getting this
=> ERROR [build 5/5] RUN yarn install --production=true 0.7s
------
> [build 5/5] RUN yarn install --production=true:
#12 0.701 Unknown Syntax Error: Invalid option name ("--production=true").
#12 0.701
#12 0.701 $ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
------
Error: failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c yarn install --production=true]: exit code: 1