-
Notifications
You must be signed in to change notification settings - Fork 682
fix(info): display correct os name on Windows 11 #4968
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
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Closes #4961
This PR upgrades the
os-namepackage from 4.0.0 to latest 5.1.0 (sindresorhus/os-name@v4.0.0...v5.1.0), which included a fix for Windows 11.Note 1: As
os-namev5 is pure ESM package, importing it withrequire('os-name')will result in an error. However, when"module": "commonjs"is set intsconfig,tscwill automatically convertawait import(...)intoawait Promise.resolve().then(() => require(...)):image
which will cause the following error when running
ionic info:To fix this, the recommended approach is to set
"module": "node16"in TypeScript 4.7 or later. During my attempt to upgrade TypeScript to 4.7, I encountered sereval type errors while runninglerna run build. I was able to resolve most of them through find and replace, and managed to successfully build 15 out of 16 packages (jonz94@8b74ed4). However, the remaining errors were different, and I felt like I did not have enough knowledge about the codebase to address those errors.In the end, I resorted to using
eval()as a quick and dirty workaround 🙃Note 2: The
import()function requires node.js >=13.2.0, and currently the minimal required node.js version is10.3.0ionic-cli/packages/@ionic/cli/package.json
Lines 10 to 12 in a2eb4b2
However, once PR #4965 (or #4972) is merged, the minimal required version will be bumped up to 16.0.0, which means this won't be an issue anymore.