R
Railway•14mo ago
linda_

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
Percy
Percy•14mo ago
Project ID: 776fe4ba-df86-4435-b8a3-68a7e5c106b7
Medim
Medim•14mo ago
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"?
linda_
linda_•14mo ago
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
ThallesComH
ThallesComH•14mo ago
try to specify the version without any semver "node": "18.14.1" if it doesn't work, i would go with a Dockerfile
linda_
linda_•14mo ago
still the same error. is there any documentation how to build it with dockerfile?
ThallesComH
ThallesComH•14mo ago
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.
ThallesComH
ThallesComH•14mo ago
railway automatically detects the Dockerfile and build from there also, you probably don't need railway.json or railway.toml.
linda_
linda_•14mo ago
alright, I'll try and I'll update tomorrow, thank you so much for your guidance
ThallesComH
ThallesComH•14mo ago
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
linda_
linda_•14mo ago
ok, will start from the scratch without 'railway.toml' and 'railway.json'
Brody
Brody•14mo ago
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
linda_
linda_•14mo ago
{ "$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 } }
Brody
Brody•14mo ago
okay you only have a railway.json?
linda_
linda_•14mo ago
toml [build] builder = "NIXPACKS" buildCommand = "npm run build --no-cache" [deploy] numReplicas = 1 startCommand = "npm run start" restartPolicyType = "ON_FAILURE" restartPolicyMaxRetries = 10
Brody
Brody•14mo ago
okay delete the railway.toml
linda_
linda_•14mo ago
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.
linda_
linda_•14mo ago
ok and then?
Brody
Brody•14mo ago
im typing hold on
linda_
linda_•14mo ago
oh ok
Brody
Brody•14mo ago
@thallescomh lol what did you do
No description
ThallesComH
ThallesComH•14mo ago
i like to put < around my links to not show the embed, percy doesn't like that 😭
Brody
Brody•14mo ago
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
}
}
{
"$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
}
}
linda_
linda_•14mo ago
ok, I'll try still error
linda_
linda_•14mo ago
Brody
Brody•14mo ago
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
}
}
{
"$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/
linda_
linda_•14mo ago
ok, i'll try
linda_
linda_•14mo ago
linda_
linda_•14mo ago
21.98 error: undefined variable 'nodejs_18'
Brody
Brody•14mo ago
wat why is nixpacks being so stubborn
linda_
linda_•14mo ago
should I delete the .nvmrc file? 18.14.1
Brody
Brody•14mo ago
nah this is a different error, ill sort it out
linda_
linda_•14mo ago
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 🫡 .
Brody
Brody•14mo ago
linda_
linda_•14mo ago
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 🫡
Brody
Brody•14mo ago
no problem! 🙂
Want results from more Discord servers?
Add your server