Hello -
I’m trying to deploy a Vue.js site to Netlify, but it is failing at the Build step.
The Netlify site name is: https://travel-bug-vue-app.netlify.app
It looks like Netlify is unable to run this command successfully: “CI= npm run build”
However, when I run npm run build
locally, it works fine.
Here is the attached error message:
9:23:01 PM: Netlify Build
9:23:01 PM: ────────────────────────────────────────────────────────────────
9:23:01 PM:
9:23:01 PM: ❯ Version
9:23:01 PM: @netlify/build 29.54.0
9:23:01 PM:
9:23:01 PM: ❯ Flags
9:23:01 PM: accountId: 60cd1045d668d87521045187
9:23:01 PM: baseRelDir: true
9:23:01 PM: buildId: 66de5be437850600081f7425
9:23:01 PM: deployId: 66de5be437850600081f7427
9:23:01 PM:
9:23:01 PM: ❯ Current directory
9:23:01 PM: /opt/build/repo
9:23:01 PM:
9:23:01 PM: ❯ Config file
9:23:01 PM: No config file was defined: using default values.
9:23:01 PM:
9:23:01 PM: ❯ Context
9:23:01 PM: production
9:23:01 PM:
9:23:01 PM: Build command from Netlify app
9:23:01 PM: ────────────────────────────────────────────────────────────────
9:23:01 PM:
9:23:01 PM: $ CI= npm run build
9:23:01 PM: > travel-bug-vue-app@0.1.0 build
9:23:01 PM: > vue-cli-service build
9:23:01 PM: sh: 1: vue-cli-service: not found
9:23:01 PM:
9:23:01 PM: “build.command” failed
9:23:01 PM: ────────────────────────────────────────────────────────────────
9:23:01 PM:
9:23:01 PM: Error message
9:23:01 PM: Command failed with exit code 127: CI= npm run build (Search results for '"non-zero exit code: 127"' - Netlify Support Forums)
9:23:01 PM:
9:23:01 PM: Error location
9:23:01 PM: In Build command from Netlify app:
9:23:01 PM: CI= npm run build
9:23:01 PM:
9:23:01 PM: Resolved config
9:23:01 PM: build:
9:23:01 PM: command: CI= npm run build
9:23:01 PM: commandOrigin: ui
9:23:01 PM: environment:
9:23:01 PM: - NODE_ENV
9:23:01 PM: - VUE_APP_MAPBOX_API_KEY
9:23:01 PM: publish: /opt/build/repo/dist
9:23:01 PM: publishOrigin: ui
9:23:02 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
9:23:02 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:23:02 PM: Failing build: Failed to build site
9:23:02 PM: Finished processing build request in 22.072s
Here are the build settings:
Runtime: Not set
Base directory: /
Package directory: Not set
Build command: CI= npm run build
Publish directory: dist
Functions directory: netlify/functions
Deploy log visibility: Logs are public
Build status: Active
I’ve reviewed several other threads on the forums, and Googled the error message, but haven’t been able to resolve the issue. I’ve also experimented with
- updating the build command on Netlify
- reinstalling @vue/cli-service
- adding @vue/cli-service as a dependency in package.json
The error message seems to suggest that there’s a problem with the build command. Does that mean the issue is somewhere within the package.json file? Specifically, the “build” script?
Would greatly appreciate any help/ideas for troubleshooting. Thank you.