facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.71k stars 26.85k forks source link

npm start not working #9954

Closed tamarapple closed 3 years ago

tamarapple commented 3 years ago

I created a new app with npx create-react-app frontend then npm start and this what I got:

$ npm start

frontend@0.1.0 start C:\Users\tamar\Desktop\React & Node Tutorial - Full ECommerce in 5 Hours [2020]\amazon\frontend react-scripts start

internal/modules/cjs/loader.js:883 throw err; ^

Error: Cannot find module 'C:\Users\tamar\Desktop\React & Node Tutorial - Full ECommerce in 5 Hours [2020]\amazon\frontend\Tutorial' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } internal/modules/cjs/loader.js:883 throw err; ^

Error: Cannot find module 'C:\Users\tamar\Desktop\react-scripts\bin\react-scripts.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! frontend@0.1.0 start: react-scripts start npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the frontend@0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\tamar\AppData\Roaming\npm-cache_logs\2020-10-29T13_38_49_213Z-debug.log

what is the problem?

dons20 commented 3 years ago

It's possible you were running it from outside the intended directory. Did you try the exact steps from here? https://reactjs.org/docs/create-a-new-react-app.html#create-react-app

npx create-react-app frontend
cd frontend
npm start
tamarapple commented 3 years ago

I may have run before in another app but I can not find it, And I followed these instructions, but it still not working

dons20 commented 3 years ago

The issue is that your folder name has a & symbol in it which causes the terminal to think that it's the start of a new command. Reference: https://stackoverflow.com/questions/60912342/error-cannot-find-module-react-scripts-bin-react-scripts-js

tamarapple commented 3 years ago

Thank you! You solved my problem!