Problem with webpack build script when deploy react project

Problem with webpack build script when deploy react project
0

Hello, I am very complicated to publish my project on github. The first time I did not have a problem, but now that I made changes in the master branch and I want to republish them I can not.
This appears when writing npm run deploy:


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack --mode production`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gabrielita/.npm/_logs/2019-06-12T02_41_22_996Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] predeploy: `npm run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] predeploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Ans this is my package.json:


{
  "homepage": "https://natcancein.github.io/drum-machine/",
  "name": "drum-machine",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "clean": "rimraf dist",
    "cleanSrc": "rimraf dist/src",
    "start": "webpack-dev-server --mode development --open --hot",
    "build": "webpack --mode production",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d dist",
    "publish-demo": "npm run build && npm run deploy"

  },
  "author": "Natalia Cancino Rojas",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.4.3",
    "@babel/plugin-proposal-class-properties": "^7.4.0",
    "@babel/preset-env": "^7.4.3",
    "@babel/preset-react": "^7.0.0",
    "babel-loader": "^8.0.5",
    "css-loader": "^2.1.1",
    "file-loader": "^3.0.1",
    "gh-pages": "^2.0.1",
    "html-webpack-plugin": "^3.2.0",
    "image-webpack-loader": "^4.6.0",
    "style-loader": "^0.23.1",
    "url-loader": "^1.1.2",
    "webpack": "^4.16.0",
    "webpack-cli": "^3.3.4",
    "webpack-dev-server": "^3.3.1"
  },
  "dependencies": {
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "rimraf": "^2.6.3",
    "styled-components": "^4.2.0"
  }
}

All help is appreciated greetings from Chile! :blush::innocent::pray::pray::pray:

What happens if you run npm run publish-demo so it does a build first?

Edit: Oh I guess it is running npm run build, it is kind of hard to tell from that log what is going wrong. Can you take a look at the actual log file being written to disk?

Not that this is a solution to your problem but I might also suggest looking into using Netlify for the deploy. It’s pretty nice and has continuous deployment so when you push to GitHub it auto rebuilds.

Thanks a lot, I’ll try with Netlify, and hope thats works, if does not work, I I will be back to write
:innocent::nerd_face::+1: