Home
Support Forums

Netlify/actions/cli build error on Github Actions

Unable to build using netlify/actions/cli

Issue with building on Github workflow spawn bash ENOENT. Tried setting default shell to bash and still getting the issue.

  • Site name: dev-tile-cto.netlify.app
  • Build on Github actions using netlify/actions/cli build
  • Error Log below
────────────────────────────────────────────────────────────────
  2. build.command from netlify.toml                            
────────────────────────────────────────────────────────────────
​
$ CI=true npm run build
​
────────────────────────────────────────────────────────────────
  "build.command" failed                                        
────────────────────────────────────────────────────────────────
​
  Error message
  Command failed with ENOENT: CI=true npm run build
  spawn bash ENOENT
​
  Error location
  In build.command from netlify.toml:
  CI=true npm run build
​
  Resolved config
  build:
    command: CI=true npm run build
    commandOrigin: config
    publish: /github/workspace/.next
    publishOrigin: ui
  functions:
    '*':
      external_node_modules:
        - config
      included_files:
        - config/*.json
        - locales/*.json
        - productCatalogs/*.json
      node_bundler: esbuild
    next_api_health:
      node_bundler: zisi
    next_image:
      node_bundler: zisi
  headers:
    - for: /*
      values:
        X-Robots-Tag: noindex
  headersOrigin: config
  plugins:
    - inputs: {}
      origin: ui
      package: '@netlify/plugin-nextjs'

Hi @ivan-tile,

I think the command should only be CI= npm run build.

hi @hrishikesh
tried both CI= npm run build and CI=true npm run build, still the same issue.
Seems it might be related to outdated node ver in netlify/actions/cli dockerfile?
Ended up just using netlify cli directly in github workflow and it works.

CLI is always the go-to tool to deploy in such cases. Glad you could get it working.