Download the latest LTS version of Node.js from here. The current latest LTS Version is 16.13.0 and it includes npm 8.1.0.
You can check which versions on Node.js and npm you have installed by running the following commands on your terminal:
node -v
npm -vThis is the output that you should see:
v16.13.0
8.1.0Install react-scripts using the following command:
npm install react-scriptsInstall the dependencies using the following command:
npm installTo see your app live on localhost, run the following command:
npm run startIf you are getting the following error while running the app,
sh: react-scripts: command not foundThen run the following commands:
rm -rf node_modules
rm -rf package-lock.jsonInstall react-scripts using the following command:
npm install react-scriptsInstall the dependencies using the following command:
npm installStart the local server by running the following command:
npm run startNote: If you are a Linux user then don't forget to add the sudo command before npm.