0

I am unable to use npm i -g create-react-app when I type this it does works but returns an error:

'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules
\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external com
mand, operable program or batch file

and second error is when i type npx create-react-app app-name:

'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules
\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external com
mand, operable program or batch file.
npx: command not found: create-react-app

Here are my local and system environment PATH variables:

Local environment variable: C:\Users\user\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Program Files\nodejs\node_modules\npm\bin;

System environment variable: C:\Users\user\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Program Files\nodejs\node_modules\npm\bin;

I already tried installing and reinstalling it .

1 Answers1

0

Sounds like a node is not installed or registered correctly. You can do all the classics:

Uninstall and re-install node

Ensure your npm path is install with env paths:

%AppData%\npm

Ensure C:\Program Files\nodejs is within your environment variables. Within "Environment Variables". Click "Edit system environment variables". Click "Environment Variables". In "System Variables" box, search for Path and edit it to include C:\Program Files\nodejs. Make sure it is separated from any other paths by a ;

Close any command prompts, etc.. an alternative is to:

set NODE_PATH %AppData%\npm\node_modules
set NODE_PATH=%AppData%\npm\node_modules

When you manually browse to, C:\Program Files\nodejs\node_modules\npm\bin do you see anything.

The second error is because node is not registered, so if you fix the first one the second one should go away

Jon Jones
  • 1,014
  • 1
  • 9
  • 17
  • I tried reinstalling already . Do i have to run rem for future ...... in cmd ? also I dont see anything such as NODE_PATH my envrionment variables are stored in PATH Also I do see stuff and files in C:\Program Files\nodejs\node_modules\npm\bin @Jon Jones – needJobCoder Aug 25 '20 at 07:50