init-windows fails silently with "unknown command" when pwsh.exe is missing; not documented in rnw-dependencies
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- node.js, powershell, react-native
- Área
- cli, documentation, tooling
Línea de trabajo
Reproduce el fallo con npx react-native init-windows --overwrite y, después, inspecciona react-native-windows/react-native.config.js y la ruta de carga de @react-native-windows/find-dotnet-tools. Comprueba la página rnw-dependencies y los metadatos de dependencias del paquete para identificar los requisitos faltantes de PowerShell y runtime-package. Se considera terminado cuando la corrección seleccionada se haya verificado frente al comportamiento indicado de 0.81.x y 0.83.x.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Description
On a fresh project, npx react-native init-windows --overwrite fails with:
error: unknown command 'init-windows'
The actual root cause is that react-native-windows's plugin throws at module-load time inside @react-native-windows/find-dotnet-tools when pwsh.exe is not on PATH:
Unable to find pwsh.exe. It should have been made available by `yarn install`.
The community CLI silently swallows the throw during plugin discovery, drops the command, and reports "unknown command" instead of the real error.
PowerShell 7 is not listed on the rnw-dependencies page. Windows ships only Windows PowerShell 5.1 by default, so most fresh machines fail this check.
This affects both [email protected] and 0.83.x. Additionally, the 0.83.x line has a missing-dependency bug: @react-native-windows/find-dotnet-tools is not in any package's dependencies but is required at runtime. Even after installing pwsh, init-windows still fails on 0.83.x until the user runs yarn add @react-native-windows/find-dotnet-tools manually.
Steps To Reproduce
On a clean Windows 11 install without pwsh.exe on PATH:
npx --yes @react-native-community/cli@latest init Test --version 0.83-stablecd Test && yarn add react-native-windows@^0.83.0npx react-native init-windows --overwrite
Result: error: unknown command 'init-windows'
To see the real underlying error, run:
node -e "require('react-native-windows/react-native.config.js')"
`Unable to find pwsh.exe. It should have been made available by yarn install.`
Expected Results
Either:
init-windowsplugin discovery is resilient to missing pwsh: defer the pwsh check until the command actually runs, so the user sees a clear "install PowerShell 7" message instead of "unknown command".- PowerShell 7 is documented as a prerequisite on the rnw-dependencies page, so users install it before reaching this step.
@react-native-windows/find-dotnet-toolsis added toreact-native-windows's (or@react-native-windows/cli's)dependenciesso it's installed transitively rather than left as a manualyarn add.
Ideally all three.
CLI version
20.0.0
Environment
System:
OS: Windows 11 10.0.26200
CPU: (20) x64 13th Gen Intel(R) Core(TM) i9-13900H
Memory: 39.55 GB / 63.45 GB
Binaries:
Node:
version: 22.23.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: C:\Program Files\nodejs\yarn.CMD
npm:
version: 10.9.8
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions:
- 10.0.19041.0
- 10.0.22621.0
- 10.0.26100.0
IDEs:
Android Studio: AI-243.24978.46.2431.13363775
Visual Studio:
- 17.14.36401.2 (Visual Studio Enterprise 2022)
Languages:
Java:
version: 17.0.13
path: C:\Program Files\Eclipse Adoptium\jdk-17.0.13.11-hotspot\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 20.0.0
wanted: 20.0.0
react:
installed: 19.1.4
wanted: 19.1.4
react-native:
installed: 0.81.6
wanted: 0.81.6
react-native-windows:
installed: 0.81.29
wanted: ~0.81.6
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Community Modules
None
Target React Native Architecture
Old Architecture (UWP) Only
Target Platform Version
10.0.22621
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
- Lenguaje dominante
- C++
- Estrellas
- 17.4k
- Forks
- 1.2k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/react-native-windows
-
Fabric text is drawn with ClearType onto transparent composition surfaces, fringing thin glyphsAbiertoNeeds: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/react-native-windows#16340 ·
Los mantenedores suelen responder en 2 días
-
bug Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/react-native-windows#16321 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Needs: Triage :mag:
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
microsoft/react-native-windows#16442 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Fabric: activating the window doesn't announce the window or the focused control to a screen readerAbiertoNeeds: Triage :mag:
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
microsoft/react-native-windows#16435 ·
Los mantenedores suelen responder en 2 días
-
bug Needs: Triage :mag:
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
microsoft/react-native-windows#16410 ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/react-native-windows
Issues similares
-
libasr headers?Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
bug iOS 🍎 ui/ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MerginMaps/mobile#4744 ·
Los mantenedores suelen responder en 1 día
-
Component: Ruby Type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 3 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
kokkos/kokkos-kernels#3328 ·
Los mantenedores suelen responder en 1 día