Z
Zerops2d ago
Saanvi

Deployment Issue

I’m trying to deploy a Node.js server, but the build is failing. What could be the probable reasons?
No description
Solution:
```yml build: os: alpine base: - nodejs@22...
Jump to solution
27 Replies
nermal
nermal2d ago
Hey @Saanvi can you check your build log? click on Open pipeline detail then build log iirc
Saanvi
SaanviOP2d ago
No description
nermal
nermal2d ago
Hey can you grab us your org id?
No description
Saanvi
SaanviOP2d ago
Yep Sure yvbhaZ67TimlmRCKDrcOQg
Saanvi
SaanviOP2d ago
No description
nermal
nermal2d ago
@Michal can you look into this please? thanks i can't see the whole build log
Michal Saloň
Michal Saloň2d ago
Your code (build section) requires Python installed, which you do not have. Try this zerops.yml
build:
os: alpine
base:
- nodejs@22
buildCommands:
- npm install
deployFiles:
- package.json
- package-lock.json
- index.js
- node_modules/
run:
os: alpine
base: nodejs@22
start: npm run dev
ports:
- port: 3000
httpSupport: true
build:
os: alpine
base:
- nodejs@22
buildCommands:
- npm install
deployFiles:
- package.json
- package-lock.json
- index.js
- node_modules/
run:
os: alpine
base: nodejs@22
start: npm run dev
ports:
- port: 3000
httpSupport: true
nermal
nermal2d ago
try this @Saanvi thanks
Michal Saloň
Michal Saloň2d ago
Also, if it requires make, which I don't think we have installed by default, you can run:
build:
os: alpine
base:
- nodejs@22
prepareCommands:
- sudo apk add make
buildCommands:
- npm install
deployFiles:
- package.json
- package-lock.json
- index.js
- node_modules/
run:
os: alpine
base: nodejs@22
start: npm run dev
ports:
- port: 3000
httpSupport: true
build:
os: alpine
base:
- nodejs@22
prepareCommands:
- sudo apk add make
buildCommands:
- npm install
deployFiles:
- package.json
- package-lock.json
- index.js
- node_modules/
run:
os: alpine
base: nodejs@22
start: npm run dev
ports:
- port: 3000
httpSupport: true
Saanvi
SaanviOP2d ago
ok i ll try this and let you know thanks !
Saanvi
SaanviOP2d ago
@Michal , Looks like some npm version issue how can we change the version ?
No description
Michal Saloň
Michal Saloň2d ago
what about the rest of the log? I think that first part is just a notice to let you know, but the actual error is below
Saanvi
SaanviOP2d ago
No description
Saanvi
SaanviOP2d ago
No description
Michal Saloň
Michal Saloň2d ago
I think thats because you didn't use my latest version: https://discord.com/channels/735781031147208777/1334177315894198414/1334184322487554099 it's complaining that there is no make, which we indeed do not have by default in our containers.
Saanvi
SaanviOP2d ago
I did use this one
No description
No description
No description
Michal Saloň
Michal Saloň2d ago
Yes, not it went further, it ran a make command which is complaining about something, I don't work with node, so I am not 100% sure, especially the error log is just not clear on what the actual error is anymore. But you should be able to set debug options to stop on command fail (see screenshot) and then enter the build container like this: https://discord.com/channels/735781031147208777/1296760913881206866/1332800481017466941 Afterwards you can try to run the commands, debug what is happening etc. and once done you can use zsc debug --help to call correct command to end the debugging. Just a note, pipeline is paused at most for 60 minutes, but that should be plenty time to figure it out. Maybe nermal has an idea what is going on?
No description
nermal
nermal2d ago
Hmmmmm @Saanvi it would be cool if you could provide me with the package.json i want to test it on my own just need to know all the dependencies this reminds me of the time when i was trying to implement llama with a discord bot :SCaraara:
Saanvi
SaanviOP2d ago
"dependencies": {
"@supabase/supabase-js": "^2.48.1",
"axios": "^1.7.9",
"biginteger": "^1.0.3",
"chalk": "^5.4.1",
"dotenv": "^16.4.7",
"express": "^4.21.2",
"fast-string-search": "^1.4.4",
"nodemailer": "^6.10.0"
}
"dependencies": {
"@supabase/supabase-js": "^2.48.1",
"axios": "^1.7.9",
"biginteger": "^1.0.3",
"chalk": "^5.4.1",
"dotenv": "^16.4.7",
"express": "^4.21.2",
"fast-string-search": "^1.4.4",
"nodemailer": "^6.10.0"
}
Don't know why its requiring Python or make
nermal
nermal2d ago
there are no other deps?
Saanvi
SaanviOP2d ago
Nope!
nermal
nermal2d ago
Hmmm questionable okay i'll check
Saanvi
SaanviOP2d ago
thanks
Solution
nermal
nermal2d ago
build:
os: alpine
base:
- nodejs@22
prepareCommands:
- sudo apk add make gcc g++
buildCommands:
- npm install
deployFiles:
- package.json
- package-lock.json
- index.js
- node_modules/
run:
os: alpine
base: nodejs@22
start: npm run dev
ports:
- port: 3000
httpSupport: true
build:
os: alpine
base:
- nodejs@22
prepareCommands:
- sudo apk add make gcc g++
buildCommands:
- npm install
deployFiles:
- package.json
- package-lock.json
- index.js
- node_modules/
run:
os: alpine
base: nodejs@22
start: npm run dev
ports:
- port: 3000
httpSupport: true
nermal
nermal2d ago
@Saanvi try this for some reason it relies on gcc and g++ too 🤔
Saanvi
SaanviOP2d ago
Worked Thnks
Michal Saloň
Michal Saloň2d ago
Build worked, but it seems like you forgot to deploy utils directory (look at the runtime log).
No description

Did you find this page helpful?