npm start (react app) gives errors on package.json
Trying to write my first react-app using node:
my command line results in Windows 10 cmd.exe:
C:\Users\ENDER\Desktop>cd react-appC:\Users\ENDER\Desktop\react-app>npm startnpm ERR! code EJSONPARSEnpm ERR! path C:\Users\ENDER\Desktop\react-app/package.jsonnpm ERR! JSON.parse Unexpected tokennpm ERR! JSON.parse in JSON at position 372 while parsing '{npm ERR! JSON.parse "name": "react-app",npm ERR! JSON.parse "version": "1'npm ERR! JSON.parse Failed to parse JSON data.npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.npm ERR! A complete log of this run can be found in:npm ERR! C:\Users\ENDER\AppData\Local\npm-cache\_logs\2021-05-17T20_43_45_067Z-debug.logC:\Users\ENDER\Desktop\react-app>
Here is the generated log file indicated at the bottom of the error message: C:\Users\ENDER\AppData\Local\npm-cache\_logs>notepad 2021-05-16T20_05_17_749Z-debug.log
0 verbose cli [0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',0 verbose cli 'C:\\Users\\ENDER\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',0 verbose cli 'start'0 verbose cli ]1 info using npm@7.13.02 info using node@v13.0.13 timing npm:load:whichnode Completed in 0ms4 timing config:load:defaults Completed in 0ms5 timing config:load:file:C:\Users\ENDER\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 15ms6 timing config:load:builtin Completed in 15ms7 timing config:load:cli Completed in 0ms8 timing config:load:env Completed in 0ms9 timing config:load:file:C:\Users\ENDER\Desktop\TomReactTutorial\React\.npmrc Completed in 0ms10 timing config:load:project Completed in 0ms11 timing config:load:file:C:\Users\ENDER\.npmrc Completed in 0ms12 timing config:load:user Completed in 0ms13 timing config:load:file:C:\Users\ENDER\AppData\Roaming\npm\etc\npmrc Completed in 0ms14 timing config:load:global Completed in 0ms15 timing config:load:validate Completed in 0ms16 timing config:load:credentials Completed in 0ms17 timing config:load:setEnvs Completed in 0ms18 timing config:load Completed in 15ms19 timing npm:load:configload Completed in 15ms20 timing npm:load:setTitle Completed in 0ms21 timing npm:load:setupLog Completed in 16ms22 timing npm:load:cleanupLog Completed in 0ms23 timing npm:load:configScope Completed in 0ms24 timing npm:load:projectScope Completed in 0ms25 timing npm:load Completed in 31ms26 timing config:load:flatten Completed in 16ms27 timing command:run-script Completed in 16ms28 timing command:start Completed in 47ms29 verbose stack Error: Missing script: "start"29 verbose stack29 verbose stack Did you mean one of these?29 verbose stack npm star # Mark your favorite packages29 verbose stack npm stars # View packages marked as favorites29 verbose stack29 verbose stack To see a list of scripts, run:29 verbose stack npm run29 verbose stack at RunScript.run (C:\Users\ENDER\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:99:13)30 verbose cwd C:\Users\ENDER\Desktop\TomReactTutorial\React31 verbose Windows_NT 10.0.1904132 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ENDER\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"33 verbose node v13.0.134 verbose npm v7.13.035 error Missing script: "start"35 error35 error Did you mean one of these?35 error npm star # Mark your favorite packages35 error npm stars # View packages marked as favorites35 error35 error To see a list of scripts, run:35 error npm run36 verbose exit 1
and the webserver started up! I guess changing the script shell helped with my path not specified issue.
But now I get:
Failed to compile../src/App.js Line 6: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 7: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 8: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 9: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 10: 'React' must be in scope when using JSX react/react-in-jsx-scope Line 12: 'React' must be in scope when using JSX react/react-in-jsx-scopeSearch for the keywords to learn more about each error.
Finally found this gem:
npm config script-shell powershell
and the webserver started up! I guess changing the script shell helped with my path not specified issue.
But now I get:
Open in new window