I have no knowledge of react and npm . In order to to learn react i am tried to follow this tutorial a youtube link!
i was instructed to run npm i -g [email protected] but i accidentally ran npm i -g create-react-app
now the files (e.g app.js) that are created are different from the tutorial
With my limited understanding i believe what has happened is that the latest version of create-react-app has got installed in my windows 10 system, and simply running npm i -g [email protected] now, is not helping me to downgrade to desired version.
=====Edit
No soluition still -
what i tried
a) - npm uninstall -g create-react-app followed by npm i -g [email protected]
b) rm -rf $DIR replace $DIR with the name of the directory created by create-react-app then rerun create-react-app
The app.js is still different from the one generated i the tutorial.
To illustrate what is the difference between two app.js files, ----
app.js using 1.5.2 - tutorial screenshot]
app.js that is getting created on my system.
import React from 'react'; import logo from './logo.svg'; import './App.css'; function App() { return ( <div className="App"> <header className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <p> Edit <code>src/App.js</code> and save to reload. Edit 2 =======
I found a solution. I have posted the answer.

create-react-appcommand made and run it again. Downgrading your global CRA module isn't gonna change any existing files in your projectrm -rf $DIRreplace $DIR with the name of the directory created by create-react-app then rerun create-react-app