Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't create new react app #11866

Open
baraaalsharif opened this issue Jan 2, 2022 · 5 comments
Open

can't create new react app #11866

baraaalsharif opened this issue Jan 2, 2022 · 5 comments

Comments

@baraaalsharif
Copy link

Describe the bug

(PS C:\Users..\OneDrive\Skrivbord\fre> npx create-react-app ecom

Creating` a new React app in C:\Users..\OneDrive\Skrivbord\fre\ecom.

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

Aborting installation.
Unexpected error. Please report it as a bug:
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:412:11)
at Object.spawn (node:child_process:698:9)
at spawn (C:\Users\baraa\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\baraa\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:390:19
at new Promise ()
at install (C:\Users\baraa\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:341:10)
at C:\Users\baraa\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:468:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}

Deleting generated file... package.json
Deleting ecom/ from C:\Users\baraa\OneDrive\Skrivbord\fre
Done.
PS C:\Users\baraa\OneDrive\Skrivbord\fre> .)

Did you try recovering your dependencies?

(

  1. npm install -g create-react-app
  2. npm cache clean --force
  3. npm install npm@latest

)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

(Environment Info:

current version of create-react-app: 5.0.0
running from C:\Users\baraa\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app

System:
OS: Windows 10 10.0.22000
CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
Binaries:
Node: 16.13.1
npm: 8.3.0

npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found.)

Steps to reproduce

(Write your steps here:)

Expected behavior

(Write what you thought would happen.)

Actual behavior

(Screenshot (5))

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@Matherss
Copy link

Matherss commented Jan 4, 2022

i have same problem... i tried all answers from stackoverflow ( delete npm, npx cache), reinstall node.js, but i still have that problem

`

PS C:\Users\Admin\Desktop\study\portfoliosite> npx create-react-app my-app
Need to install the following packages:
create-react-app
Ok to proceed? (y) y
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

Creating a new React app in C:\Users\Admin\Desktop\study\portfoliosite\my-app.

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

Aborting installation.
Unexpected error. Please report it as a bug:
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:412:11)
at Object.spawn (node:child_process:698:9)
at spawn (C:\Users\Admin\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\Admin\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:390:19
at new Promise ()
at install (C:\Users\Admin\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:341:10)
at C:\Users\Admin\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:468:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}

Deleting generated file... package.json
Deleting my-app/ from C:\Users\Admin\Desktop\study\portfoliosite
Done.
PS C:\Users\Admin\Desktop\study\portfoliosite>

`

PS C:\Users\Admin\Desktop\study\portfoliosite> node -v
v16.13.1
PS C:\Users\Admin\Desktop\study\portfoliosite> npm -v
8.3.0
PS C:\Users\Admin\Desktop\study\portfoliosite> npx -v
8.3.0

@AnthonyLzq
Copy link

I got this strange message when running:

$ npx create-react-app my-app
    
Need to install the following packages:
  create-react-app
Ok to proceed? (y) y

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/

System:

  • OS: Manjaro Linux x86_64 - 5.15.12-1-MANJARO
  • CPU: AMD Ryzen 7 5800H with Radeon Graphics (16) @ 3.200GHz

Binaries:

  • Node: 16.13.1
  • npm: 8.3.0

@dominicfarr
Copy link

dominicfarr commented Feb 8, 2022

I get this error as well.

  • Mac V12.1
  • Node version 14.x 16.x, and 17.x
  • npm cache clean --force
  • sudo npm uninstall -g create-react-app
  • npx clear-npx-cache

Nothing seems to work.

My work around, add the version.

npx create-react-app@5.0.0 app-name

EDIT
Using a versioned create-react-app only works on 14.x, not 17.x

@DylanSp
Copy link

DylanSp commented Feb 9, 2022

Possible duplicate of #12022.

@patotoma
Copy link

Duplicate of #10670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants