React Router Lesson - npm start not working


I am doing the React Router lesson (

I was able to follow the steps all the way up to starting the live React app. So, I did npm install, installed [email protected] , and imported BrowserRouter from react-router-dom and rename it to Router .

However, I am running into an issue when trying to start the React app locally using ‘npm start’

npm ERR! Missing script: “start”
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm star # Mark your favorite packages
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run

I have npm version 8.19.2

My package.json has “start”: “react-scripts start” so I’m unsure what’s going on?

I even tried to replace that line with “start”: “react-scripts --openssl-legacy-provider start” as I saw in another post, but I’m receiving the same error.

I had the same problem and found that the issue was that I was trying to start React while on the react-router-lesson-starter-1 directory, so npm was reading the package.json file in the first folder. When I switched to the react-router-lesson-starter folder inside the react-router-lesson-starter-1 folder and then tried to start React, the start was successful as it was reading the package.json that actually contains the start script. But the rendering was unsuccessful as I probably installed the newer version of React Router. Hope this helps :slightly_smiling_face: