[Solved] React Startup Error at the First time :SyntaxError: Unexpected token

[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: