Home > OS >  npx create-react-app my-app command not working
npx create-react-app my-app command not working

Time:01-13

It is showing this error:

npx : The term 'npx' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • npx create-react-app my-app
  •     CategoryInfo          : ObjectNotFound: (npx:String) [], CommandNotFoundException
        FullyQualifiedErrorId : CommandNotFoundException
    

Why this command is not working?? I'm trying it for first time..

CodePudding user response:

If npx is not recognized, then it is not a problem with react itself. It means that your machine can't execute npx command / Not able to find npxin your machine for some reason.

Might be

You have an old version of the NPM that doesn't contain npx at all.

You can check this using npm -v command

Paths are not set up correctly (It looks like you are using Windows machine). Check the PATH

CodePudding user response:

npx comes with Node.js. Try running

npm -v

in command prompt. If you see an error message or a version below 5.2.0 (npx was included in npm since version 5.2.0), follow the below steps to reinstall Node.js :-

  1. Check and reinstall if you already have an unwanted version of Node.js
  2. If you're on windows go to Control Panel -> Programs -> Programs and Features
  3. If Node.js is there, uninstall it since it could be a corrupt version
  4. Go to the official site of Node.js to download and install Node.js with the required configurations
  • Related