I can’t create a project with create-React-app

Asked

Viewed 2,110 times

1

I can no longer create apps with create-React-app, I have already created some projects using create-React-app, but now it has stopped working.

I run the following command to create an application:

> npx create-react-app my-app
npx: installed 98 in 18.156s

Creating a new React app in C:\Workspace\react\my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 13 new dependencies.
info Direct dependencies
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
info All dependencies
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 62.02s.

The process simply stops running after installing dependencies, src and public folders are not created.

Can anyone give me any hint on how to fix this or where I can find more logs of the problem?

I suspect it’s something to do with git, since the next step after installing dependencies is to initialize the git repository.

Grateful, V. Goulart

1 answer

3


Usually problems with the create-react-app occur when you have a version installed on your machine and then are trying to execute the command with an older version, as per documentation (free translation):

If you’ve installed the create-react-app globally via npm install -g create-react-app, recommend uninstalling the package using the npm uninstall -g create-react-app to ensure that the npx always use the latest version.

The equivalent command in the yarn is yarn global remove create-react-app.

If the problem persists after removing the package, I found an alternative in that question soen. Use the command which create-react-app (Linux / Mac) or where create-react-app (Windows) and, if it returns a path to the directory of create-react-app, just remove this directory and try again.

  • I removed the folder and it worked, thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.