Skip to content

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

Description

@NiketanG

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions