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

2 comments:

  1. The 'create-react-app' is not recognized as an internal or external command error can be confusing when setting up a React development environment. This article explains how using npx helped resolve the issue and highlights the importance of understanding Node.js versions and command execution. Such troubleshooting guides are valuable for developers who encounter environment-related problems while following tutorials.

    For learners who want to build a strong foundation in React development, ReactJS Online Training in India offers a relevant starting point for exploring React concepts and building interactive user interfaces.

    ReplyDelete
  2. Developers interested in extending their skills to mobile application development can also explore React Native Online Training in India to learn about building cross-platform mobile applications using JavaScript and React.

    ReplyDelete

The "Mark as Decorative" Feature in SharePoint: A Small Toggle With a Big Accessibility Impact

If you've spent any time building pages in SharePoint Online, you've probably noticed a new checkbox tucked inside the Accessibility...