Node.js v18.12.1 is not supported by Astro, how to update to : ">=18.14.1"?
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
GitHub - withLinda/AstroWind: Trying Astro 3.0 + Tailwind CSS for m...
Trying Astro 3.0 + Tailwind CSS for my website. Contribute to withLinda/AstroWind development by creating an account on GitHub.
35 Replies
Project ID:
776fe4ba-df86-4435-b8a3-68a7e5c106b7
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"
?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/[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
try to specify the version without any semver
"node": "18.14.1"
if it doesn't work, i would go with a Dockerfile
still the same error.
is there any documentation how to build it with dockerfile?
you can use the dockerfile provided by Astro https://docs.astro.build/en/recipes/docker/
Astro Documentation
Build your Astro Site with Docker
Learn how to build your Astro site using Docker.
railway automatically detects the Dockerfile and build from there
also, you probably don't need
railway.json
or railway.toml
.alright, I'll try and I'll update tomorrow, thank you so much for your guidance
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 guessok, will start from the scratch without
'railway.toml'
and 'railway.json
'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
{
"$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
}
}
okay you only have a railway.json?
toml
[build]
builder = "NIXPACKS"
buildCommand = "npm run build --no-cache"
[deploy]
numReplicas = 1
startCommand = "npm run start"
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 10
okay delete the railway.toml
this is the repository: https://github.com/withLinda/AstroWind
GitHub
GitHub - withLinda/AstroWind: Trying Astro 3.0 + Tailwind CSS for m...
Trying Astro 3.0 + Tailwind CSS for my website. Contribute to withLinda/AstroWind development by creating an account on GitHub.
ok
and then?
im typing hold on
oh ok
@thallescomh lol what did you do
i like to put
<
around my links to not show the embed, percy doesn't like that ðŸ˜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
ok, I'll try
still error
okay let me think
try this
and you can download your build or deploy logs with this
https://bookmarklets.up.railway.app/log-downloader/
ok, i'll try
still error
21.98 error: undefined variable 'nodejs_18'
wat
why is nixpacks being so stubborn
should I delete the .nvmrc file? 18.14.1
nah this is a different error, ill sort it out
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 🫡 .
i will 🫡
heres a working on railway template
https://github.com/brody192/astrowind-template
https://railway.app/template/Ic0JBh
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 🫡no problem! 🙂