Netlify deploy failing in Gitlab CI/CD pipeline

I have a NEXT.JS project that has a netlify.toml file at the root of the project.

In the netlify.toml file, I have specified the build command as “CI= npm run build”, and there is a package.json file at the project root with the “build” command in the “scripts” section.

But everytime I run the Gitlab pipeline, I get the following error:
────────────────────────────────────────────────────────────────

[174] “build.command” failed

[175]────────────────────────────────────────────────────────────────

[176]

[177]Error message

[178]Command failed with ENOENT: CI= npm run build

[179]spawn bash ENOENT

[180]

[181]Error location

[182]In build.command from netlify.toml:

[183]CI= npm run build

I’ll appreciate any help on this.

Figured this one out. I was using a node alpine image, and alpine images don’t ship with bash.

This post helped - Build command failed using the Netlify CLI (on GitLab runner)

1 Like