During the establishment of the work environment, Moshe asks to install the specific version he is teaching about (1.5.2).
{npm i -g create-react-app@1.5.2}
{create-react-app react-app}
I tried to follow the instructions but the environment comes up with many errors and some of the folders do not exist (src, public).
I installed the latest version (to check that the problem is not local om my machine), and the environment works without errors.
{npx install -g create-react-app@latest}
{create-react-app react-app}
The problem is that it is difficult to follow the lesson because some of the command structure looks different. That starts from the first drill.
I wonder how to proceed … I would appreciate your advice.
Thanks
Yeah, that version is very old (published in 2018; the major release is now at version 5) and probably has dependencies which you are using newer versions of without even knowing. If I were taking the course, I would probably do my best to figure out how to translate the commands into their newest version. That means there will be some variation from what Mosh is showing in the videos, but it is also very similar to what happens in real life: dependencies change and you have to update your codebase to keep up.
In most cases you can probably search for things like “replacement command for … in React” or you could look through the release notes at each major release to see what breaking changes were contained. For example, check out these release notes to see breaking changes from 4.0.x to 5.0.0: Release v5.0.0 · facebook/create-react-app · GitHub
Maybe you can even make a thread on here for helping others by documenting the current replacements for some of the commands when using v5.0.x. Maybe others would even be willing to contribute and help out.