Netlify not Building. "build.command" failed - what to do?

PLEASE help us help you by writing a good post!

My netlify app is `musing-roentgen-805196. However, I can’t post it. there some issues and I can’t resolve them.


thank you for help!!

The issue in the screenshot is that the build command is run build but it should be npm run build.

I see you resolved that issue already though.

I checked a newer deploy and the error message has changed. The new error is about a missing dependency:

1:02:34 PM: $ CI= npm run build
1:02:35 PM: > calendar@0.1.0 build /opt/build/repo
1:02:35 PM: > react-scripts build
1:02:36 PM: Creating an optimized production build...
1:02:48 PM: Failed to compile.
1:02:48 PM: 
1:02:48 PM: ./src/index.scss
1:02:48 PM: To import Sass files, you first need to install node-sass.
1:02:48 PM: Run `npm install node-sass` or `yarn add node-sass` inside your workspace.
1:02:48 PM: Require stack:
1:02:48 PM: - /opt/build/repo/node_modules/sass-loader/dist/getDefaultSassImplementation.js
1:02:48 PM: - /opt/build/repo/node_modules/sass-loader/dist/getSassImplementation.js
1:02:48 PM: - /opt/build/repo/node_modules/sass-loader/dist/index.js
1:02:48 PM: - /opt/build/repo/node_modules/sass-loader/dist/cjs.js
1:02:48 PM: - /opt/build/repo/node_modules/loader-runner/lib/loadLoader.js
1:02:48 PM: - /opt/build/repo/node_modules/loader-runner/lib/LoaderRunner.js
1:02:48 PM: - /opt/build/repo/node_modules/webpack/lib/NormalModule.js
1:02:48 PM: - /opt/build/repo/node_modules/webpack/lib/NormalModuleFactory.js
1:02:48 PM: - /opt/build/repo/node_modules/webpack/lib/Compiler.js
1:02:48 PM: - /opt/build/repo/node_modules/webpack/lib/webpack.js
1:02:48 PM: - /opt/build/repo/node_modules/react-scripts/scripts/build.js
1:02:48 PM: npm ERR! code ELIFECYCLE
1:02:48 PM: npm ERR! errno 1
1:02:48 PM: npm ERR! calendar@0.1.0 build: `react-scripts build`
1:02:48 PM: npm ERR! Exit status 1
1:02:48 PM: npm ERR!
1:02:48 PM: npm ERR! Failed at the calendar@0.1.0 build script.
1:02:48 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
1:02:48 PM: npm ERR! A complete log of this run can be found in:
1:02:48 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-09-22T20_02_48_555Z-debug.log

The solution for this would be to add node-sass to package.json. The logs also state the solution for that:

Run npm install node-sass or yarn add node-sass inside your workspace.

Would you please try running that command in the base of the repo? Once that is done, commit the change to package.json to the repo and push the change upstream.

If that doesn’t resolve the issue, please let us know.