0

I went into the root directory of my React program and tried to npm start, but it no longer works. I also tried npm install before starting, but get the same error.

This occurred after I installed Java for some reason. I've since uninstalled it and removed the path the JRE and JDK directories. I also tried reinstalling npm from the npm site.

Here is the error message I get when trying to run the program

npm ERR! file C:\Program Files\Java\jdk1.8.0_211\jre
npm ERR! path C:\Program Files\Java\jdk1.8.0_211\jre
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Program Files\Java\jdk1.8.0_211\jre
npm ERR! create-react-redux-app@0.1.0 start: `react-scripts start`
npm ERR! spawn C:\Program Files\Java\jdk1.8.0_211\jre ENOENT
npm ERR!
npm ERR! Failed at the create-react-redux-app@0.1.0 start 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!     C:\Users\James Damazos\AppData\Roaming\npm-cache\_logs\2019-05-06T17_45_48_357Z-debug.log

my npm version is 6.4.1. I removed the path to jdk1.8.0_211 from environment variables, but I don't know why it still searches for it in the error message

For reference, here's my package.json

{
  "name": "create-react-redux-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^3.0.1",
    "bad-words": "^1.6.4",
    "bignumber.js": "^7.2.1",
    "font-awesome": "^4.7.0",
    "gsap": "^2.0.2",
    "history": "^4.7.2",
    "immutable": "^3.8.1",
    "jquery": "^3.3.1",
    "material-icons-react": "^1.0.2",
    "prop-types": "^15.5.10",
    "react": "^16.4.0",
    "react-dom": "^16.4.0",
    "react-icons": "3.2.2",
    "react-redux": "^5.0.6",
    "react-router-dom": "^4.2.0",
    "react-router-redux": "^5.0.0-alpha.6",
    "react-select": "^2.0.0",
    "react-slidedown": "^1.3.0",
    "react-spinkit": "^3.0.0",
    "react-tooltip": "^3.6.1",
    "react-web3": "^0.4.5",
    "react-youtube": "^7.8.0",
    "redux": "^3.7.2",
    "redux-devtools-extension": "^2.13.5",
    "redux-saga": "^0.15.6",
    "sweetalert2": "^7.26.12",
    "uuid": "^3.3.2",
    "web3": "github:ethereum/web3.js"
  },
  "devDependencies": {
    "eslint": "5.6.0",
    "eslint-config-airbnb": "15.1.0",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-jsx-a11y": "5.1.1",
    "eslint-plugin-react": "7.3.0",
    "lint-staged": "^4.0.4",
    "pre-commit": "^1.2.2",
    "react-scripts": "2.1.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "lint": "npm run lint:js",
    "lint:staged": "lint-staged",
    "lint:js": "eslint --ext .js src/"
  },
  "pre-commit": "lint:staged",
  "lint-staged": {
    "*.js": "lint:js"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

and here is what my log file looks like

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle create-react-redux-app@0.1.0~prestart: create-react-redux-app@0.1.0
6 info lifecycle create-react-redux-app@0.1.0~start: create-react-redux-app@0.1.0
7 verbose lifecycle create-react-redux-app@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle create-react-redux-app@0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\marbleGenerator\MibsFrontEnd\node_modules\.bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Program Files\nodejs\;C:\Users\James Damazos\.windows-build-tools\python27\;C:\Users\James Damazos\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Users\James Damazos\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\.bin;C:\Users\James Damazos\AppData\Roaming\npm\node_modules\.bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Users\James Damazos\AppData\Local\Microsoft\WindowsApps;C:\Users\James Damazos\AppData\Local\atom\bin;C:\Users\James Damazos\AppData\Local\atom;C:\cygwin64\bin;D:\Scrap\remixd\bin;C:\Users\James Damazos\AppData\Local\Microsoft\WindowsApps;D:\Microsoft VS Code\bin;D:\watchman.exe;C:\Users\James Damazos\AppData\Roaming\npm
9 verbose lifecycle create-react-redux-app@0.1.0~start: CWD: D:\marbleGenerator\MibsFrontEnd
10 silly lifecycle create-react-redux-app@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 info lifecycle create-react-redux-app@0.1.0~start: Failed to exec start script
12 silly lifecycle create-react-redux-app@0.1.0~start: Returned: code: -4058  signal: null
13 info lifecycle create-react-redux-app@0.1.0~start: Failed to exec start script
14 verbose stack Error: create-react-redux-app@0.1.0 start: `react-scripts start`
14 verbose stack spawn C:\Program Files\Java\jdk1.8.0_211\jre ENOENT
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
14 verbose stack     at onErrorNT (internal/child_process.js:415:16)
14 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
15 verbose pkgid create-react-redux-app@0.1.0
16 verbose cwd D:\marbleGenerator\MibsFrontEnd
17 verbose Windows_NT 10.0.17763
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 verbose node v10.15.3
20 verbose npm  v6.4.1
21 error file C:\Program Files\Java\jdk1.8.0_211\jre
22 error path C:\Program Files\Java\jdk1.8.0_211\jre
23 error code ELIFECYCLE
24 error errno ENOENT
25 error syscall spawn C:\Program Files\Java\jdk1.8.0_211\jre
26 error create-react-redux-app@0.1.0 start: `react-scripts start`
26 error spawn C:\Program Files\Java\jdk1.8.0_211\jre ENOENT
27 error Failed at the create-react-redux-app@0.1.0 start script.
27 error This is probably not a problem with npm. There is likely additional logging output above.
28 verbose exit [ 1, true ]
KaneHarry729
  • 95
  • 1
  • 2
  • 12
  • Do you have calls to run Java within your `package.json`? What does your `package.json` look like? – zero298 May 06 '19 at 17:55
  • Doesn't look like it. I've posted my ```package.json``` – KaneHarry729 May 06 '19 at 17:58
  • Check here https://stackoverflow.com/questions/39959900/npm-start-error-with-create-react-app ... Perhaps it might help. – Lovato May 06 '19 at 19:48
  • @lovato already tried that, didn't help unfortunately – KaneHarry729 May 06 '19 at 20:02
  • What does this say `C:\Users\James Damazos\AppData\Roaming\npm-cache\_logs\2019-05-06T17_45_48_357Z-debug.log`? – Nikko Khresna May 07 '19 at 01:37
  • Did you install stuff globally or locally? Global installs are usually a bad idea, talking about project dependencies. If the problem is in your PC, you can try wiping your project, clone it again, and do a npm install. Besides that, gets quite complicated. You can try Docker for fresh setups inside your setup, if in hurry. – Lovato May 07 '19 at 10:59
  • @NikkoKhresna I posted the .log file. It appears it tries to search for Java's JDK and JRE for some reason. I've since uninstalled and removed them. – KaneHarry729 May 07 '19 at 14:27

0 Answers0