Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'npm run build' results in Command failed with ENOENT: npm run build #57

Open
NiketanG opened this issue Feb 22, 2022 · 3 comments
Open

Comments

@NiketanG
Copy link

NiketanG commented Feb 22, 2022

Using the action to build and then deploy a Next.js Project to Netlify from Github CI/CD. The Config is as follows:

      - name: 🧰 Install dependencies for Next.js Build
        run: npm install
        
      - name: 📦 Run Next.js build to generate the static files
        run: npm run build

      - name: 🚀 Deploy to Netlify
        id: deploy-netlify
        uses: netlify/actions/cli@master
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
        with:
          args: build


This uses the netlify-plugin-nextjs. Which fails to build the project (execute npm run build) with the following error:

Screenshot from 2022-02-23 01-43-51

@grgcnnr
Copy link

grgcnnr commented Apr 23, 2022

Did you ever get a resolution for this @NiketanG ? I'm having a similar issue

@mcolombosperoni
Copy link

Did you ever get a resolution for this @NiketanG ? I'm having a similar issue

Me too. I think it is due to the alpine image. Maybe using the not alpine one solve the issue, cause I think it is due to the fact that in alpine docker image version the bash is not installed by default

axisofentropy added a commit to axisofentropy/foodadvisor that referenced this issue Aug 25, 2022
axisofentropy added a commit to axisofentropy/foodadvisor that referenced this issue Sep 13, 2022
@alexjorgef
Copy link

alexjorgef commented Dec 17, 2022

I guess this issue is related to https://answers.netlify.com/t/build-command-failed-using-the-netlify-cli-on-gitlab-runner/43543/5

I figured out the problem, the node:15.14.0-alpine Docker image doesn’t have bash included which netlify build relies on for running the build command on Linux.

The spawn bash ENOENT error was because it couldn’t find bash.

It seems that the ‘alpine’ Node Docker images don’t have bash and this was fixed by using the standard image: node:15.14.0 instead.

Got there in the end.

Thanks for your help, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants