'create-react-app bash: /usr/local/bin/create-react-app: No such file or directory
I had an origonal problem that I tried to fix and got another problem
1. ORIGONAL PROBLEM I just tried to install a new react app using create-react-app and got this error first
Please note that global installs of create-react-app are no longer supported.
The node modules were installed but none of the other files or directories that normally install.
2. What I did to fix Origonal problem on the react app website it https://create-react-app.dev/docs/getting-started/ it was suggested that I do the following (which I did)
"If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version."
I tried to run the command npm uninstall -g create-react-app but could not do it as my mac prevented it so ran sudo npm uninstall -g create-react-app
3. New PROBLEM
When I now run create-react-app I get the message
bash: /usr/local/bin/create-react-app: No such file or directory
TDI-MacBook-Air:Active bob$
What do I need to do to get create react App back. I am worried about messing up my installation more so am hesitant to go at it without some advice
Solution 1:[1]
Just simply run npx create-react-app app_name to create your app.
npx will fetch the latest version of create-react-app and setup your app.
Solution 2:[2]
This solved my error Just simply run npx create-react-app app_name to create your app. npx will fetch the latest version of create-react-app and setup your app.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Himanshu Mehta |
| Solution 2 | rlandster |
