R
Railway

✋|help

Node.js v18.12.1 is not supported by Astro, how to update to : ">=18.14.1"?

Wwithlinda9/11/2023
Anyone can help me, please? Got this error while building Astro, how to update to : ">=18.14.1"?

The repository: https://github.com/withLinda/AstroWind

[stage-0 8/10] RUN --mount=type=cache,id=s/776fe4ba-df86-4435-b8a3-68a7e5c106b7-node_modules/cache,target=/app/node_modules/.cache npm run build --no-cache:

0.738 > @onwidget/astrowind@1.0.0-beta.4 build

0.738 > astro build

0.738

0.848 Node.js v18.12.1 is not supported by Astro!

0.848 Please upgrade Node.js to a supported version: ">=18.14.1"

0.848

0.851 null CI Environment Detected!

0.851 Additional steps may be needed to set your Node.js version:

0.851 Documentation: https://docs.astro.build/guides/deploy
Mmedim9/11/2023
Weird, cause u are specifying "node": ">=18.14.1"
on ur package.json
what happens if u just put the major version "node": ">=18.14"?
Wwithlinda9/11/2023
Already put
"engines": {
"node": ">=18.14"
}
still the same error
[stage-0 8/10] RUN --mount=type=cache,id=s/776fe4ba-df86-4435-b8a3-68a7e5c106b7-node_modules/cache,target=/app/node_modules/.cache npm run build --no-cache:

0.773 > @onwidget/astrowind@1.0.0-beta.4 build

0.773 > astro build

0.773

0.899 Node.js v18.12.1 is not supported by Astro!

0.899 Please upgrade Node.js to a supported version: ">=18.14.1"

0.899

0.903 null CI Environment Detected!

0.903 Additional steps may be needed to set your Node.js version:

0.903 Documentation: https://docs.astro.build/guides/deploy
Tthallescomh9/11/2023
try to specify the version without any semver
"node": "18.14.1"
if it doesn't work, i would go with a Dockerfile
Wwithlinda9/11/2023
still the same error.
is there any documentation how to build it with dockerfile?
Tthallescomh9/11/2023
you can use the dockerfile provided by Astro https://docs.astro.build/en/recipes/docker/
railway automatically detects the Dockerfile and build from there
also, you probably don't need railway.json or railway.toml.
Wwithlinda9/11/2023
alright, I'll try and I'll update tomorrow, thank you so much for your guidance
Tthallescomh9/11/2023
if you can, try to remove railway.json or railway.toml. I don't know if Railway (nixpacks) will not use the engine provided in package.json because of those files.
just a guess
Wwithlinda9/11/2023
ok, will start from the scratch without 'railway.toml' and 'railway.json'
Bbrody1929/11/2023
you can do this without a dockerfile
it's easier if I explain by showing you, but for that I'd need to see your nixpacks.toml and railway.json files
Wwithlinda9/11/2023
{ "$schema": "https://railway.app/railway.schema.json", "build": { "builder": "NIXPACKS", "buildCommand": "npm run build" }, "deploy": { "numReplicas": 1, "startCommand": "npm run start", "restartPolicyType": "ON_FAILURE", "restartPolicyMaxRetries": 10 } }
Bbrody1929/11/2023
okay you only have a railway.json?
Wwithlinda9/11/2023
toml
[build] builder = "NIXPACKS" buildCommand = "npm run build --no-cache" [deploy] numReplicas = 1 startCommand = "npm run start" restartPolicyType = "ON_FAILURE" restartPolicyMaxRetries = 10
Bbrody1929/11/2023
okay delete the railway.toml
Wwithlinda9/11/2023
this is the repository: https://github.com/withLinda/AstroWind
ok
and then?
Bbrody1929/11/2023
im typing hold on
Wwithlinda9/11/2023
oh ok
Bbrody1929/11/2023
@thallescomh lol what did you do
Tthallescomh9/11/2023
i like to put < around my links to not show the embed, percy doesn't like that 😭
Bbrody1929/11/2023
ah i see, yeah not to throw anyone under the bus but the link change detection logic isnt the best
this should cause nixpacks to use node 18.14.1
reference https://github.com/NixOS/nixpkgs/commit/cfdcb8d7fa7ae40616ec304eac07048d5a9e28ea
{
  "$schema": "https://schema.up.railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS",
    "buildCommand": "npm run build",
    "nixpacksPlan": {
      "phases": {
        "setup": {
          "nixPkgsArchive": "cfdcb8d7fa7ae40616ec304eac07048d5a9e28ea"
        }
      }
    }
  },
  "deploy": {
    "numReplicas": 1,
    "startCommand": "npm run start",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}
Wwithlinda9/11/2023
ok, I'll try
still error
Wwithlinda9/11/2023
Bbrody1929/11/2023
okay let me think
try this
{
  "$schema": "https://schema.up.railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS",
    "buildCommand": "npm run build",
    "nixpacksPlan": {
      "phases": {
        "setup": {
          "nixPkgs": ["nodejs_18"],
          "nixPkgsArchive": "cfdcb8d7fa7ae40616ec304eac07048d5a9e28ea"
        }
      }
    }
  },
  "deploy": {
    "numReplicas": 1,
    "startCommand": "npm run start",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}

and you can download your build or deploy logs with this
https://bookmarklets.up.railway.app/log-downloader/
Wwithlinda9/11/2023
ok, i'll try
Wwithlinda9/11/2023
still error
Wwithlinda9/11/2023
21.98 error: undefined variable 'nodejs_18'
Bbrody1929/11/2023
wat
why is nixpacks being so stubborn
Wwithlinda9/11/2023
should I delete the .nvmrc file? 18.14.1
Bbrody1929/11/2023
nah this is a different error, ill sort it out
Wwithlinda9/11/2023
ok
it's 1:44 am in my place, I should sleep now, would you please kindly update here if you found the solution? I'll try the solution tomorrow, thank you so much for your help, King Brody 🫡 .
Bbrody1929/12/2023
Wwithlinda9/12/2023
Wow, thank you so much, Brody, you are a genius, Clever of you to use 0.0.0.0 as the host and update both the package.json and the toml.:
[phases.setup] nixpkgsArchive = 'cfdcb8d7fa7ae40616ec304eac07048d5a9e28ea'

and the command:
"dev": "astro dev", "start": "node dist/server/entry.mjs", "build": "astro build",

once again, thank you, King 🫡
Bbrody1929/12/2023
no problem! 🙂

Looking for more? Join the community!

Recommended Posts
bundo railway have support for bun in the near feature?Issue Deploying Next.js 13 with Bun 1.0For better or worse I've decided to follow the hype train and am trying to get Bun 1.0 working with Pricing QuestionsI'm looking for some clarification regarding Railway's pricing structure. I've noticed that the 'HobDeploying via github always crashes after 4-5 minutesI am creating a discord bot and when I commit to github and deploy it, it starts fine at first. But Deploying bun 1.0in bun cause I don't need to build files is their somehow I can skip the build step since it alreadyWhere can you store Media Files?I'm using Django and have added a blog module to it where users can upload their own images. I was wEasy (?) shared variables questionThe environment contains the excellent Payload CMS template, attendant Mongo DB, and a Next.js frontPlan update issueIm having a issue with plan update. It just shows: Problem processing payment method and I triple cCan't create an account: Device requesting login is not supported. Please try again from a secure coTrying to create a new Railway Account, but getting this error: ```Device requesting login is not saccess to resource inside replicahi, when we setup an instance to have 2 replicas, how do we get the resource related to 1 of the reCommunicate between services with private networkProject ID: 3f51dcb4-6905-4a13-be75-4c6063e4324a I am trying to set up Railway to communicate betweWeb Server Not WorkingI just started a small simple web server. I generated a custom domain for now, and when trying to achttp://0.0.0.0:8000 to urlI am using a Django REST framework. When I query the URL at 0.0.0.0:8000 I can get a response, but aOpenSearch deploymentHi everyone. I require assistance with deploying an instance of OpenSearch since I get an error durUnable to connect with private networkHey guys, I'm a bit unsure on how to use the internal network. I have a .net api that has a privaterclone on railway to transfer data from one cloud to an other.Hello, I'm creating an app the requires to transfer data from one cloud storage (like onedrive to aBun 1.0 on railwayI am spinning up a simple bun app with 1 file in it. But for some reason all of my builds are failinSocket cannot be archivedWhen building the railway project I get a message saying that: /Users/x/Library/Application SupportBUN 1.0 + AstroHas anyone tried to deploy a Bun app yet? I am getting this error. ERROR: failed to solve: processDjango Railway admin consoleHi! I've had a really good time using Railway thus far, sea-change from setting up an EC2 instance