2

Getting this error while creating react file ? C:\Users\tusha\Desktop\New folder (4)>npx create-react-app my-app '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 command, operable program or batch file. node:internal/modules/cjs/loader:1078 throw err; ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) at Module._load (node:internal/modules/cjs/loader:920:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Node.js v18.15.0

I have tried to re-install nodejs and delete the module by creating the module file again ?

Heel_tushar
  • 21
  • 1
  • 2

1 Answers1

1

Your npm installation doesn't appear to be in your PATH.

Open a command prompt (windows key + R, then cmd.exe)

Update your PATH to include npm.

setx PATH "%PATH%;C:\Program Files\nodejs\npm"

Close the terminal command prompt.

If your npm binary is in a different location, you can find it via the command prompt using

where npm
Stephen Taylor
  • 798
  • 7
  • 19
  • This appears on the screen C:\Users\tusha>where npm C:\Program Files\nodejs\npm C:\Program Files\nodejs\npm.cmd C:\Users\tusha>setx PATH "%PATH%;C:\Program Files\nodejs\npm" WARNING: The data being saved is truncated to 1024 characters. SUCCESS: Specified value was saved. BUT STILL I AM NOT ABLE TO CREATE ANY REACT FILE – Heel_tushar Mar 16 '23 at 04:50