Support Forums

Command failed with exit code 1: npm run build.. please help

I need advice to debug deploy Netlify App

I’ve tried everything from changing node version, changing deploy settings, build command, run npm init in vscode to create a new package.json file , but I keep getting the message: “Command failed with exit code 1: npm run build”

this is my json file:

“title”: “npm”,
“name”: “ikigaibrazil-travel-page”,
“version”: “5.0.9”,
“scripts”: {
“start”: “gulp watch”
“description”: “A travel & immigration blog built with VScode”,
“keywords”: [
“homepage”: “Brazil Travel & Immigration”,
“bugs”: {
“url”: “Issues · StartBootstrap/startbootstrap-landing-page · GitHub”,
“email”: “feedback@startbootstrap.com
“license”: “MIT”,
“author”: “Start Bootstrap”,
“contributors”: [
“David Miller (https://davidmiller.io/)”
“repository”: {
“type”: “git”,
“url”: “git+https://github.com/remyduijn/Ikigai-Brazil.git”
“dependencies”: {
@fortawesome/fontawesome-free”: “5.15.1”,
“bootstrap”: “4.5.3”,
“jquery”: “3.5.1”,
“simple-line-icons”: “2.5.5”
“devDependencies”: {
“browser-sync”: “2.26.13”,
“del”: “6.0.0”,
“gulp”: “4.0.2”,
“gulp-autoprefixer”: “7.0.1”,
“gulp-clean-css”: “4.3.0”,
“gulp-header”: “2.0.9”,
“gulp-plumber”: “^1.2.1”,
“gulp-rename”: “2.0.0”,
“gulp-sass”: “4.1.0”,
“merge-stream”: “2.0.0”
“main”: “contact.js”

The error is here:


which is because of:

There’s no script named 'build. You need to add one.

Hi @hrishikesh , thank you for your reply!

I have added the ‘build’ as follows:
“scripts”: {
“build”: “node app.js”

However, it still doesn’t work. I have no idea what to write inside…I have found this online, but I cannot find a source that explains what should be written inside a build script in package.json. Sorry for the maybe obvious solutions to these problems but I have no idea how this all works.

hi remy, which command do you use to build your project locally (offline)?

Hi Perry, I just click on ‘run and debug’ in vscode :joy: I’m sorry if that sounds like a total amateur :sweat_smile:

hi remy, no problem. Looking at your git repo, it seems like you are not using a SSG (static site generator) and just deploying already finished HTML pages, is that correct?

in that case, the build command isn’t needed. can you try removing it, and see what happens?

Yes just deploying already finished HTML pages.

If I remove the build command, it gives me this error:

npm ERR! missing script: build

Your build command is still set to npm run build: Netlify App

You need to remove that. Publish directory should also be blank.

1 Like

Great, it worked, thank you! :pray:t3:

1 Like