I recently created a test application using React Native by running
npx react-native init Test --template react-native-template-typescript
(https://reactnative.dev/docs/typescript). Everything seemed to be working fine, but I encountered an issue where the TypeScript template could not be found (view log as text
| view log as pictures).Next, I navigated into the project directory with
cd Test
, and followed the documentation to run npx react-native-windows-init --overwrite
as detailed in the documentation. This step was successful, you can check the log here.However, when attempting to execute
npx react-native run-windows
as instructed, I received an error message stating Build failed with message Building Solution - error code 1. Check your build configuration
(log here or picture)
Actions taken:
- I tried running the rnw-dependencies.ps1 script both directly on my PC and via
in an elevated PowerShell session. Although the script resulted in a large error message during the installation ofSet-ExecutionPolicy Unrestricted -Scope Process -Force; iex (New-Object System.Net.WebClient).DownloadString('https://aka.ms/rnw-deps.ps1')
, after installing all components manually, the script runs without errors. However, the build error still persists.Compilers, build tools, SKDs and Visual Studio
- I installed the
component within Visual StudioMSVC v143 - VS 2022 C++-x64/x86-Buildtools (latest)
- I also installed the
Windows 10 SDK (10.0.19041.0)
My current setup includes:
- Operating System: Windows 10
- nvm Version:
v1.1.7
- Node.js Versions Tried:
v14.18.1
(current),v17.5.0
,v12.18.3
(both unsuccessful) - Visual Studio Community Version: 2022 - 17.1.0 (components and workloads are visible here)
- npx Version:
v6.14.15
- react-native-cli Version:
v2.0.1
- yarn Version:
v1.22.15