[react] prompt syntaxerror: unexpected token
1. background
Use react scaffold to build the project
- Install globally: npm i -g create-react-app
- create-react-app hello-react
- Go to the project folder: cd hello-react
- Start the project: npm start
When executing npm start, an error occurred, please check the node version.
2. problem-solving
- The investigation found that it was caused by the node version.
- execute node -v ;
- react-app requires node version greater than 14
- execute nvm use 14;
- Just restart.
Read More:
- [Solved] Error in created hook: “SyntaxError: Unexpected token o in JSON at position 1“
- Error in created hook: “SyntaxError: Unexpected token u in JSON at position 0
- [Solved] Uncaught SyntaxError: Unexpected token ‘<‘
- How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0
- [Solved] Webpack compile error: SyntaxError: Unexpected token =
- [Solved] vue Project Error: react lazy eslint error Parsing error: Unexpected token import
- ArcGIS API for JavaScript version 4. X updated and the project startup error: Module parse failed: Unexpected token(… …
- [Solved] React Error: ReactDOM.render is no longer supported in React 18.
- [Solved] React Invariant Violation: Minified React error #130
- node.js yarn Error: SyntaxError: Unexpected string [How to Solve]
- [Solved] Vue unit test syntax error: unexpected token ‘export‘
- [Solved] react-router-dom Error: index.js:1 Warning: Functions are not valid as a React child.
- [Solved] React Dependency Error: Invalid tag name “^np.0.2“ of package “react@^np.0.2“: Tags may not have an
- Vue Import three.JS error: Unexpected token [How to Solve]
- [Solved] ajax Error: Uncaught SyntaxError: Unexpected end of JSON input
- How to Solve React devtools plug-in Error
- [Solved] ESLint: Parsing error: Unexpected token(prettier/prettier)
- React: How to Solve Web3 import error
- [Solved] react-quill failed to install error: Could not resolve dependency
- [Solved] vite2+vue3 jsx Error: React is not defined