0

error messages when running npx create-react-app

When trying to create a new react app using create-react-app generator I seem to run into a this downloading error. Not sure how to fix it. I've use npx create-react-app many time before but recently it has stopped working. Any suggestions?

Andrewcarey@Andrews-MacBook-Air Strangers_Things % npx create-react-app my-app
internal/modules/cjs/loader.js:311
      throw err;
      ^

Error: Cannot find module '/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/brace-expansion/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:303:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/minimatch/minimatch.js:10:14)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/brace-expansion/package.json',
  requestPath: 'brace-expansion'
}
npm ERR! code 1
npm ERR! path /Users/andrewcarey/Desktop/Strangers_Things
npm ERR! command failed
npm ERR! command sh -c create-react-app "my-app"

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/andrewcarey/.npm/_logs/2021-06-01T00_36_33_693Z-debug.log

2 Answers2

0

what I normally do is let say I want my project to be called "my-app" I create a folder "my-app" open it in my terminal and then type npx create-react-app ./ I'm not sure if this is the best solution but maybe give it a try and see if it works

Ryan JT
  • 70
  • 2
  • 12
0

type in the powershell npm install -g create-react-app then type create-react-app todos-listenter image description here