Error When Installing React

Hi, I am trying to install react using the following command that Mosh used in his react tutorial:
sudo npm install -g create-react-app@1.5.2

The problem is I get an error message saying “Error: Cannot find module ‘semver’”.

I have attached an image of the entire error message.

To fix this problem, I have run the following code:
sudo rm -rf /usr/local/lib/node_modules

sudo rm -rf ~/.npm

brew uninstall --force node

brew install node

The problem still persists after doing this.

Just do npx create-react-app react-app. the course is outdated so that method doesn’t work

Madlobt, but unfortunately, when I try the following command:
“npx create-react-app react-app”

I get an error saying the following:
“Error: Cannot find module ‘libnpx’”

You should probably reinstall node or npm

Hi Lashvardi,

I just posted a similar question than came across your reply over here. I used npx create-react-app react-app and now its seems to be working. Thank you!!

Really need create-react-app , you might need to reinstall Node and reconfigure your dependencies
myaccountaccess.com