0

Hello guys I'm struggling to deploy my react app tried some stuff but didn't work hope you can help
this is my GitHub repo :https://github.com/azizlar4/project-

this is the error I keep getting :

   ​
    12:14:58 PM: $ CI= npm run build
    12:14:58 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
    12:14:58 PM: npm WARN config location in the cache, and they are managed by
    12:14:58 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
    12:14:58 PM: npm ERR! Missing script: "build"
    12:14:58 PM: npm ERR!
    12:14:58 PM: npm ERR! To see a list of scripts, run:
    12:14:58 PM: npm ERR!   npm run
    12:14:58 PM: npm ERR! A complete log of this run can be found in:
    12:14:58 PM: npm ERR!     /opt/buildhome/.npm/_logs/2022-08-03T11_14_58_339Z-debug-0.log
    12:14:58 PM: ​
    12:14:58 PM: ────────────────────────────────────────────────────────────────
    12:14:58 PM:   "build.command" failed                                        
    12:14:58 PM: ────────────────────────────────────────────────────────────────
    12:14:58 PM: ​
    12:14:58 PM:   Error message
    12:14:58 PM:   Command failed with exit code 1: CI= npm run build (https://ntl.fyi/exit-code-1)
    12:14:58 PM: ​
    12:14:58 PM:   Error location
    12:14:58 PM:   In Build command from Netlify app:
    12:14:58 PM:   CI= npm run build
    12:14:58 PM: ​
    12:14:58 PM:   Resolved config
    12:14:58 PM:   build:
    12:14:58 PM:     command: CI= npm run build
    12:14:58 PM:     commandOrigin: ui
    12:14:58 PM:     publish: /opt/build/repo
    12:14:58 PM:     publishOrigin: default
    12:14:58 PM: Caching artifacts

1 Answers1

0
"scripts": {
    "dev": "webpack --config=Scripts/config/webpack.dev.js --watch",
    "build": "webpack --config=Scripts/config/webpack.prod.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

You need to add a second line i.e "build": "webpack --config=Scripts/config/webpack.prod.js" in your package.json file.

Shilpe Saxena
  • 219
  • 2
  • 8