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

bug: macOS 12 monterey is not supported #566

Closed
3 tasks done
eun-choi opened this issue Nov 1, 2021 · 7 comments · Fixed by #573
Closed
3 tasks done

bug: macOS 12 monterey is not supported #566

eun-choi opened this issue Nov 1, 2021 · 7 comments · Fixed by #573

Comments

@eun-choi
Copy link

eun-choi commented Nov 1, 2021

Bug Report

Problem

What is expected to happen?

Build should also succeed on macOS 12(monterey).

What does actually happen?

Build fails on macOS 12.0.1

Information

cordova 10.0.0 uses macos-release 2.4.1 version in package-lock.json

In order to have no problems on macOS 12, macos-release version 2.5.0 is required.

Command or Code

Environment, Platform, Device

Occurs with macos 12.0.1 and cordova 10.0.0

Version information

Cordova: cordova 10.0.0, cordova-ios 6.2.0
Other Frameworks: @ionic/cli 6.18.0, macos 12.0.1, xcode 13.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@arturvt
Copy link

arturvt commented Nov 1, 2021

I forked and updated the required libs to make it work. I can send a PR if it's allowed.
The issue is with "os-name" lib. It should be updated to "^5.0.0".

I updated the libs related below, but it didn't update the lib we want, so I added as dependency into main package.json and it worked.

Here's the solution for unblocking you:

  1. Clone the cli project2
  2. Update those libs:
  • "cordova-lib": "^10.1.0",
  • "insight": "^0.11.1",
  • "systeminformation": "^5.9.9",
  • "os-name": "^5.0.0",
  1. run npm link cordova

@erisu
Copy link
Member

erisu commented Nov 1, 2021

macos-release version 2.5.0 is required.

We do not pin exact direct dependent packages and some of these sub packages are not pinned too. Just reinstall Cordova CLI so it will fetch macos-release@2.5.0

npm uninstall -g cordova
npm install -g cordova

$ npm ls macos-release
cordova@10.0.0 /Users/cdv/n/lib/node_modules/cordova
└─┬ insight@0.10.3
  └─┬ os-name@3.1.0
    └── macos-release@2.5.0

@eun-choi
Copy link
Author

eun-choi commented Nov 2, 2021

Before re-install:

cordova@10.0.0 /usr/local/lib/node_modules/cordova
└─┬ insight@0.10.3
  └─┬ os-name@3.1.0
    └── macos-release@2.4.1 

> cordova build ios
/usr/local/lib/node_modules/cordova/node_modules/macos-release/index.js:27
const [name, version] = nameMap.get(release);

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

After re-install:

cordova@10.0.0 /usr/local/lib/node_modules/cordova
└─┬ insight@0.10.3
  └─┬ os-name@3.1.0
    └── macos-release@2.5.0 

This problem was solved by reinstalling.
However, if you upgrade macOS 12 with it already cordova 10 installed,
I suspect others will have the same problem.
Because, it's been over a year since the cordova 10.0.0 version was released.

https://github.com/apache/cordova-cli/blob/master/package-lock.json
3860 lines:

    "macos-release": {
      "version": "2.4.1",
      "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz",
      "integrity": "sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg=="
    },

I know that dependencies are pinned to insight 0.10.3.
If you update the insight dependency to version 0.11.1,
I think there should be no problem.

https://github.com/apache/cordova-cli/blob/master/package.json
32 lines:

    "insight": "^0.10.3",

@theblang
Copy link

For posterity, here's the issue from the dependency repository.

@purplecabbage
Copy link
Contributor

This is happening again with Ventura ... we need a future proof fix

@breautek
Copy link
Contributor

breautek commented Dec 30, 2022

This is happening again with Ventura ... we need a future proof fix

Probably just get rid of insight package. We use it to display the "consumer" name of the Mac version instead of the Darwin version.

But unfortunately the underlying package can't see in the future nor do they gracefully handle unknown Darwin versions. Instead we can just use the NodeJS APIs (OS.platform() / OS.release() / OS.version()). Platform will provide darwin on macs, and either release() or version() will provide the version. OS.version() might be pretty much a direct replacement since it returns "Windows 10 Pro" rather than the actual OS version. (release() appears to return the actual version, e.g: 10.0.19045

Someone with a mac can confirm, but this is probably a better path forward and we get to manage one less dependency.

@rajohns08
Copy link

rajohns08 commented Jan 25, 2023

Yeah looks like the insight package is basically throwing in the towel on this issue, and the creator removed it from his own product: yeoman/insight#83. So that is likely the best path forward for cordova as well.

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

Successfully merging a pull request may close this issue.

7 participants