Node.js npm Start not working

Hi! I am trying to run the command create-react-app In Git Bash. This command works, but after that, I am trying to run the command npm start & git bash throws this error:

'Aaroosh\AppData\Roaming\npm\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:960
  throw err;
  ^

Error: Cannot find module 'C:\Users\Rudra \node_modules\create-react-app\index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Can somebody help me?

Thanks!

Did you use npx create-react-app?

I used npx create-react-app & another error comes up:

Error: EPERM: operation not permitted, mkdir 'C:\Users\Rudra'
The system cannot find the path specified.
Install for [ 'create-react-app@latest' ] failed with code 1

make sure you create the directory you want to store your your react app in
Either npx create-react-app my-directory
or
mkdir my-directory
cd my-directory
npx create-react-app . (include the dot so it knows to make the app in that directory)

My code is still throwing an error(the same error) I tried 3 times & it isn’t working.
Here is a screenshot:

image

if you are in first-app
npx create-react-app .

gotta have a space between app and “.”

I did that. Node.js is STILL throwing the SAME ERROR over & over again:

Sorry for the messy post… the screenshot came out messy. hope you can see the error.

I can see it.
This might be a windows thing, which I can’t help you with. Just copy the error text into google and see what comes up, might be some type of -sudo command you have to run.
Good luck!

The problem here looks to be being caused by the Windows user account you have created.

I have never seen an account with spaces in it and it is creating a home folder with those same spaces.

The problem is compounded by the fact you are using a Linux shell (Git Bash) and it is unable to resolve those spaces.

The error shows that it is being cut off at the first space in the user account name.

C:\Users\Rudra

Usually within a Windows cmdline shell, if you have a filepath that has spaces you need to wrap everything in double quotes. ie “c:\folder with spaces”, especially if its part of a command line application.

Easiest thing would be to create another Windows account with out spaces in and login with that and then you can use the desktop to save stuff.

Or you would have to create your project in a folder with an absolute path, ie c:\projects.

Or you could attempt you used the Windows Command Line and not use Git Bash.

Thank you @nessie2015! The absolute path strategy worked!!