0

This is the error :

my-app@0.1.0 start /home/gaurav/Desktop/Django + React/Saurav Hardware/saurav_hardware/my-app react-scripts start

                sh: 1: react-scripts: not found
                npm ERR! code ELIFECYCLE
                npm ERR! syscall spawn
                npm ERR! file sh
                npm ERR! errno ENOENT
                npm ERR! my-app@0.1.0 start: `react-scripts start`
                npm ERR! spawn ENOENT
                npm ERR! 
                npm ERR! Failed at the my-app@0.1.0 start script.
                npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
                npm WARN Local package.json exists, but node_modules missing, did you mean to install?

                npm ERR! A complete log of this run can be found in:
                npm ERR!     /home/gaurav/.npm/_logs/2020-05-20T20_38_00_671Z-`enter code here`debug.log



            [// This is my package.json]
            {
              "name": "my-app",
              "version": "0.1.0",
              "private": true,
              "dependencies": {
                "@testing-library/jest-dom": "^4.2.4",
                "@testing-library/react": "^9.5.0",
                "@testing-library/user-event": "^7.2.1",
                "react": "^16.13.1",
                "react-dom": "^16.13.1",
                "react-icons": "^3.10.0",
                "react-router-dom": "^5.2.0",
                "react-scripts": "3.4.1"
              },
              "scripts": {
                "start": "react-scripts start",
                "build": "react-scripts build",
                "test": "react-scripts test",
                "eject": "react-scripts eject"
              },
              "eslintConfig": {
                "extends": "react-app"
              },
              "browserslist": {
                "production": [
                  ">0.2%",
                  "not dead",
                  "not op_mini all"
                ],
                "development": [
                  "last 1 chrome version",
                  "last 1 firefox version",
                  "last 1 safari version"
                ]
              }
            }

This is happening everytime I try to start npm. It was working fine yesterday but it stopped totally.What should I do? What is missing in this package.json file? I also can't be able to install node modules.......!

  • Can you include your `package.json` – awarrier99 May 20 '20 at 20:51
  • Just delete package-lock.json and I hope it gone – El. May 20 '20 at 20:59
  • 1
    Delete your `node_modules` directory, run the command `npm install`, and then try again – awarrier99 May 20 '20 at 21:03
  • Local package.json exists, but node_modules missing, did you mean to install? –  May 20 '20 at 21:03
  • Does this answer your question? [How do I debug "Error: spawn ENOENT" on node.js?](https://stackoverflow.com/questions/27688804/how-do-i-debug-error-spawn-enoent-on-node-js) – Garrett Motzner May 20 '20 at 21:04
  • npm ERR! Unexpected end of JSON input while parsing near '..."semantic-release":"^' npm ERR! A complete log of this run can be found in: npm ERR! /home/gaurav/.npm/_logs/2020-05-20T23_36_17_200Z-debug.log –  May 20 '20 at 23:39

1 Answers1

0

You haven't installed all of your modules. Run npm install to install the modules specified in package.json and then npm start should work. Note from the error message that react-scripts is not found, which is your clue that the package is not installed

awarrier99
  • 3,628
  • 1
  • 12
  • 19
  • npm install npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm ERR! Unexpected end of JSON input while parsing near '...,"jest-resolve":"24.9' npm ERR! A complete log of this run can be found in: npm ERR! /home/gaurav/.npm/_logs/2020-05-20T21_10_08_916Z-debug.log This is my error. –  May 20 '20 at 21:12
  • @gauravraj can you try running these two commands `npm cache clean --force && npm update` and then try again – awarrier99 May 20 '20 at 21:15
  • @gauravraj refer to this [answer](https://stackoverflow.com/questions/47675478/npm-install-errorunexpected-end-of-json-input-while-parsing-near-nt-webpack) on why you're receiving the `Unexpected end of JSON input` error – awarrier99 May 20 '20 at 21:18