0

i was working on React 17.0.2 but today i moved on to React 18.0.2 i faced a problem when using(npm start): i tried all solutions like installing react-scripts and npm i and uninstalling react modules but nothing worked

PS D:\Nageeb\Code\Laravel&React\ecommerce-frontend> npm start 
> ecommerce-frontend@0.1.0 start
> react-scripts start
'React\ecommerce-frontend\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:936
  throw err;

Error: Cannot find module 'D:\Nageeb\Code\react-scripts\bin\react-scripts.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
PS D:\Nageeb\Code\Laravel&React\ecommerce-frontend>
Nageeb Darwish
  • 81
  • 1
  • 2
  • 8

3 Answers3

0

Try deleting node_modules folder and running npm i on the root folder.

Luka Cerrutti
  • 667
  • 1
  • 4
  • 9
0

i found the solution the main folder that the project inside it contain (&) in its name i deleted it and it worked

Nageeb Darwish
  • 81
  • 1
  • 2
  • 8
0

The problem is causing "&" in the name of your folder - "Laravel&React". Try to rename the folder to e.g. "laravel_and_react" and re-run "npm start" again.

Marko Sikman
  • 345
  • 3
  • 8