You are able to apply the following solution:
$ npm config set prefix /usr/local
$ sudo npm install -g create-react-app
$ create-react-app my-app
Use of create react app on Mac platform (command not found)
Labels (space delimited): react
Before the beginning of BB: as a new front-end Xiaobai, in order to self-study front-end bought some books to see, half a year later. If you think you have achieved the right result, you can kill all the people. However, it turns out that there are people outside, there is a day outside, and I am still the original Xiaobai… So I planned to practice again. Who would have met the pit in the first step
Gorgeous dividing line
Problem Description:
Today, in the process of learning react, the first thing is to build the environment (Environment Building Article). After browsing the above link article, I found that there are two ways to build the react environment. The first one is relatively simple, so I decided to use the first one to build the environment. But who would have thought that there was a problem:
“`shell
create-react-app hello
“`
After executing the above code, create react app: command not found is returned with an error, which means that the command does not exist
Thinking process:
At first glance, I thought it might be that it was not installed in the global environment, so I deleted it first, and then passed it
“`shell
npm install -g create-react-app
“`
I thought it was this problem, but the result is still abnormal
After consulting the data and looking at the NPM documents, I found that the NPM install – G command installed the module in the/usr/local/lib directory by default. So I went to the directory to find out whether the create react app module was successfully installed
Similar Posts:
- error [email protected]: The engine “node” is incompatible with this module.
- Uncaught SyntaxError: The requested module ‘/node_modules/.vite/react-router……Switch
- Creating react webpack project through yeoman
- [Solved] React Project Start Error: Uncaught TypeError: Cannot read property ‘forEach‘ of undefined
- How to Solve React-native-gesture-handler Error
- React Run Error: Uncaught TypeError: Cannot read property ‘forEach‘ of undefined
- Using react native elements in RN project to report an error: unrecognized font family ‘material icons’
- [Solved] React Native Error: A problem occurred configuring project ‘:app’. and Execution failed for t…
- How to Use Yarn instead of NPM