sai krishna
sai krishna

Reputation: 11

When I write npx create-react-app-my-app " in CMD windows I m getting an error. I've installed Node.js : C:\Users\dev>node --version v15.4.0****

When I write npx create-react-app-my-app in CMD windows I'm getting an error.

I have installed Node.js:

C:\Users\dev>node --version
v15.4.0

error:

node:internal/modules/cjs/loader:928
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'

at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)

at Function.Module._load (node:internal/modules/cjs/loader:769:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)

at node:internal/main/run_main_module:17:47 {

  code: 'MODULE_NOT_FOUND',

  requireStack: []

}

node:internal/modules/cjs/loader:928

  throw err;

  ^



Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npx-cli.js'

[90m    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)[39m

[90m    at Function.Module._load (node:internal/modules/cjs/loader:769:27)[39m

[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)[39m

[90m    at node:internal/main/run_main_module:17:47[39m {

  code: [32m'MODULE_NOT_FOUND'[39m,

  requireStack: []

}

Upvotes: 1

Views: 656

Answers (3)

Capt 171
Capt 171

Reputation: 665

@Danila Volosov the author uses CMD and Windows as mentioned in OP, and rm -rf does not work on Windows.
NPM is looking for npm-cli.js under C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\, which is wrong and doesn't exist. This occurs when the path is set wrongly, so find the following in the PATH env:

C:\Program Files\nodejs\node_modules\npm\bin

and replace it with

C:\Program Files\nodejs

It'll probably work after this.

You can also take a look at the following:

Upvotes: 0

user3646714
user3646714

Reputation: 1

please add the command below, I hope this solves your problem: node ./src/index.js

Upvotes: 0

user13610500
user13610500

Reputation:

What you need is npx create-react-app my-app. You can replace 'my-app' with what you want to name the application. Your command is currently missing the space.

Upvotes: 2

Related Questions