Closed liudonghua123 closed 2 years ago
Many of our core contributors are taking some much needed vacation throughout December 2021. Thank you for being patient while we relax, recharge, and return to a normal responsiveness in January 2022. In the meantime feel free to continue to pose questions, open issues, and make feature requests - you just may not get a response right away.
cc @chrisglein @asklar this is the second person who hit the regression that prevents building with multiple versions of Visual Studio. See https://github.com/microsoft/react-native-windows/issues/8471 for the other. Are we providing any support for the dependencies script?
I added a workaround in https://github.com/microsoft/react-native-windows/pull/8571 that silences failures in the dependency script. This will land in 0.67 by default but may be worth backporting to 0.65 and 0.66.
@NickGerleman Thanks for you resources. Now I add a --latest
option in vswhere locally, then everything worked.
$vsPath = & $vsWhere -version 16.5 -property installationPath --latest;
Seems like adding --latest
to the dependency script will handle this. That does mean we might get noise from prerelease builds of VS that we haven't tested yet, although those are issues we'll have to track eventually. It also means there's ability for someone to choose which version they use here (if they don't want latest). But for the most common case, using latest seems like the right case.
Seems like adding --latest to the dependency script will handle this.
This isn't quite correct either. The CLI has logic to locate the latest version of VS that has the required dependencies to install. So the dependencies script could use a different version than the CLI, which would find the correct version.
For the CLI, the powershell script could maybe allow it to pass its own resolved VS path? IMO the script should just be in JS, so it can directly interface with health checks, and the run-windows code we've iterated on to solve these issues more reliably.
the dependencies script cannot be in JS, since it must have an environment to run that JS, which does not exist inbox. Windows developers don't usually have node installed, e.g..
@asklar do you think it would be reasonable to require users to install Node before running the script? I think that is the story for other platforms.
Another option might be for the Powershell dependencies script to "bootstrap" node if not installed but defer to doctor after ensuring we had a valid JS environment. So, basically the dependencies script would become a JS environment installer, to load doctor, which is the RN standard tool.
@NickGerleman Thanks for you resources. Now I add a
--latest
option in vswhere locally, then everything worked.$vsPath = & $vsWhere -version 16.5 -property installationPath --latest;
Hi i seem to have the same error
Get-ChildItem : Der Pfad "C:\Common7\IDE\Extensions\" kann nicht gefunden werden, da er nicht vorhanden ist.
In C:\Users\name\Documents\name\name\name\node_modules\react-native-windows\Scripts\rnw-dependencies.ps1:174 Zeichen:19
+ ... $natvis = Get-ChildItem "$vsPath\Common7\IDE\Extensions\cppwinrt.na ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Visual Studio L...ed. Error 0x57:String) [Get-ChildItem], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
but sadly the fix from NickGerleman didn't work.
okay i now see it's not entirely the same, for me it's a DriveNotFoundException
I get still the same Error.
What i did found, was that the path in line 174
"$vsPath\Common7\IDE\Extensions\cppwinrt.natvis"
does not exist, there is no Common7 Folder under
ProgramFiles(x86)\Microsoft Visual Studio\Installer\
I will try reinstalling VSCode
"react": "^17.0.2", "react-native": "^0.66.0", "react-native-windows": "^0.66.6", node --version: v16.13.1 yarn --version: 1.22.15 Win 10, 40GB RAM The Node.js Version in VSCode Info is Different
Version: 1.63.2 (user setup)
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Datum: 2021-12-15T09:40:02.816Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
Betriebssystem: Windows_NT x64 10.0.19042
@asklar Do we have a solution in mind for this?
Problem Description
I followed the instruction on https://microsoft.github.io/react-native-windows/docs/getting-started#install-react-native-for-windows, and when I run
npx react-native run-windows
oryarn start
, I got the following errors.So I go through the
rnw-dependencies.ps1:174
and found the problem is$vsPath
has two values in my environment.https://github.com/microsoft/react-native-windows/blob/c7646fa4ae5ca6a6204e7b210b25c30bcdc844ff/vnext/Scripts/rnw-dependencies.ps1#L173-L174
If I add a
--latest
option invswhere
, then it works.Steps To Reproduce
Expected Results
work expected as https://microsoft.github.io/react-native-windows/docs/getting-started
CLI version
6.3.0
Environment
Target Platform Version
No response
Target Device(s)
Desktop
Visual Studio Version
No response
Build Configuration
No response
Snack, code example, screenshot, or link to a repository
No response