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

52 messages · Page 1 of 1 (latest)

tulip frigate
#

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/[email protected] 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

GitHub

Trying Astro 3.0 + Tailwind CSS for my website. Contribute to withLinda/AstroWind development by creating an account on GitHub.

toxic shuttleBOT
#

Project ID: 776fe4ba-df86-4435-b8a3-68a7e5c106b7

tribal meteorBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

past sandal
#

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"?

tulip frigate
#

[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/[email protected] 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

midnight knoll
#

if it doesn't work, i would go with a Dockerfile

tulip frigate
tulip frigate
midnight knoll
#

railway automatically detects the Dockerfile and build from there

#

also, you probably don't need railway.json or railway.toml.

tulip frigate
midnight knoll
#

just a guess

tulip frigate
#

ok, will start from the scratch without 'railway.toml' and 'railway.json'

radiant cipher
#

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

tulip frigate
#

{ "$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 } }

radiant cipher
#

okay you only have a railway.json?

tulip frigate
#

toml
`[build]
builder = "NIXPACKS"
buildCommand = "npm run build --no-cache"

[deploy]
numReplicas = 1
startCommand = "npm run start"
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 10`

radiant cipher
#

okay delete the railway.toml

tulip frigate
tulip frigate
#

and then?

radiant cipher
#

im typing hold on

tulip frigate
#

oh ok

radiant cipher
#

@midnight knoll lol what did you do

midnight knoll
#

i like to put < around my links to not show the embed, percy doesn't like that 😭

radiant cipher
#

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
  }
}
tulip frigate
#

ok, I'll try

#

still error

radiant cipher
#

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/

tulip frigate
#

ok, i'll try

#

21.98 error: undefined variable 'nodejs_18'

radiant cipher
#

wat

#

why is nixpacks being so stubborn

tulip frigate
#

should I delete the .nvmrc file? 18.14.1

radiant cipher
#

nah this is a different error, ill sort it out

tulip frigate
#

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 🫡 .

radiant cipher
#

i will 🫡

radiant cipher
tulip frigate
radiant cipher
#

no problem! 🙂