Hello!
I have been trying to deploy my Netifly site for some time now and can’t seem to get past “Build Command Failed. Error Code 127”.
Here is some further context:
Netifly site name: https://capable-douhua-25721f.netlify.app](https://capable-douhua-25721f.netlify.app/
Build log:
3:02:10 PM: Netlify Build
3:02:10 PM: ────────────────────────────────────────────────────────────────
3:02:10 PM:
3:02:10 PM: ❯ Version
3:02:10 PM: @netlify/build 29.33.6
3:02:10 PM:
3:02:10 PM: ❯ Flags
3:02:10 PM: baseRelDir: true
3:02:10 PM: buildId: 65ca32e4981da200076e434a
3:02:10 PM: deployId: 65ca32e4981da200076e434c
3:02:10 PM:
3:02:10 PM: ❯ Current directory
3:02:10 PM: /opt/build/repo
3:02:10 PM:
3:02:10 PM: ❯ Config file
3:02:10 PM: No config file was defined: using default values.
3:02:10 PM:
3:02:10 PM: ❯ Context
3:02:10 PM: production
3:02:10 PM:
3:02:10 PM: Build command from Netlify app
3:02:10 PM: ────────────────────────────────────────────────────────────────
3:02:10 PM:
3:02:10 PM: $ webpack --config webpack.config.js
3:02:10 PM: bash: webpack: command not found
3:02:10 PM:
3:02:10 PM: “build.command” failed
3:02:10 PM: ────────────────────────────────────────────────────────────────
3:02:10 PM:
3:02:10 PM: Error message
3:02:10 PM: Command failed with exit code 127: webpack --config webpack.config.js (Search results for '"non-zero exit code: 127"' - Netlify Support Forums)
3:02:10 PM:
3:02:10 PM: Error location
3:02:10 PM: In Build command from Netlify app:
3:02:10 PM: webpack --config webpack.config.js
3:02:10 PM:
3:02:10 PM: Resolved config
3:02:10 PM: build:
3:02:10 PM: base: /opt/build/repo
3:02:10 PM: command: webpack --config webpack.config.js
3:02:10 PM: commandOrigin: ui
3:02:10 PM: environment:
3:02:10 PM: - NODE_VERSION
3:02:10 PM: - NPM_VERSION
3:02:10 PM: publish: /opt/build/repo/public
3:02:10 PM: publishOrigin: ui
3:02:11 PM: Failed during stage “building site”: Build script returned non-zero exit code: 2
3:02:11 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:02:11 PM: Failing build: Failed to build site
3:02:11 PM: Finished processing build request in 14.007s
I’m struggling with what to do next to try and fix it. I had a look through the forums and saw lots of people mention issues around the 127 error code but nothing directly related to Webpack.
When I run my build command locally “webpack --config webpack.config.js”, everything seems to work as expected:
webpack --config webpack.config.js
[BABEL] Note: The code generator has deoptimised the styling of /Users/alfiebatten/Desktop/garbs/garbs/src/components/landingSection/landingLogo.js as it exceeds the max of 500KB.
assets by status 138 MiB [cached] 23 assets
assets by path . 2.22 MiB
asset bundle.js 2.22 MiB [compared for emit] (name: main) 1 related asset
asset index.html 876 bytes [emitted]
runtime modules 2.6 KiB 9 modules
modules by path ./src/ 1.04 MiB (javascript) 26.3 KiB (asset)
modules by path ./src/components/ 1.04 MiB 45 modules
modules by path ./src/.scss 2.95 KiB
./src/index.scss 1.19 KiB [built] [code generated]
./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/index.scss 1.76 KiB [built] [code generated]
./src/index.js 989 bytes [built] [code generated]
./src/BiggerDisplay.otf 42 bytes (javascript) 26.3 KiB (asset) [built] [code generated]
modules by path ./node_modules/ 1.09 MiB
modules by path ./node_modules/style-loader/dist/runtime/.js 5.84 KiB 6 modules
modules by path ./node_modules/react-dom/ 1000 KiB 3 modules
modules by path ./node_modules/css-loader/dist/runtime/*.js 3.33 KiB 3 modules
modules by path ./node_modules/react/ 85.7 KiB 2 modules
modules by path ./node_modules/scheduler/ 17.3 KiB 2 modules
webpack 5.90.1 compiled successfully in 1512 ms
If anyone knows of anything that may fix it I would love to hear it!
Thanks so much,
Alfie