Wednesday 21 February 2024

'create-react-app' is not recognized as an internal or external command

Issue:

Recently there was an issue we face while training React. Generally we give training using video series on YouTube but this time we pass on training blog from c-sharp corner learn module. The installation process showcase we need to install node js and then run command "create-react-app" to create react app. But it gave us below error:

Error - 'create-react-app' is not recognized as an internal or external command.


Analysis:

The command was the correct one and we generally use that. So the issue has to be something with the environment. When I checked the resolution for this in google, it suggested to use "npx" before the command. When we use that, it created the react app. So, I checked the git repository for the explanation of this.


Resolution:

So, the issue we face was due to node version installed. As per the git repository, if you have node version 5.1 or higher, you need to add "npx" before the command. if the version is lover, you can directly use the command to create the app. 

I am trying to reach the author to include this as note in the post. As comments is not allowed in the post, I am writing this blog to help someone if they face the same issue. 


Reference:

  • https://www.c-sharpcorner.com/learn/reactjs-for-beginners/introduction-to-react-js
  • https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f

No comments:

Post a Comment