LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.7k stars 152 forks source link

The 'openfolder' is not supported on Apple Silicon devices on macOS Ventura 13.0.1 #218

Open linhongyi opened 1 year ago

linhongyi commented 1 year ago

I'm using the latest version (0.6.4) of node-appdmg.

I found out that this problem has been solved on other osx versions. But I am on macOS Ventura 13.0.1, and I still encounter the same problem.

The log is as follows.

Error: Command failed: bless --folder /Volumes/xxxx --openfolder /Volumes/xxxx bless: The 'openfolder' is not supported on Apple Silicon devices.

Any solution thanks.

sadihakan commented 1 year ago

Same here:

(node:17717) UnhandledPromiseRejectionWarning: Error: Command failed: bless --folder /Volumes/... 1 --openfolder /Volumes/... 1 bless: The 'openfolder' is not supported on Apple Silicon devices.

Christilut commented 1 year ago

Same problem here. My terminal is in i386 but it still reports this error so it's unable to complete a build

pzhlkj6612 commented 1 year ago

Hi, please have a look at #216 .

sadihakan commented 1 year ago

Unfortunately it didn't help #216.

Chentai-Kao commented 1 year ago

I ran into this problem since updated to macOS Ventura 13.0.1 yesterday. As a hacky workaround, I commented out the following line in node_modules/appdmg/lib/appdmg.js:

args.push('--openfolder', global.temporaryMountPath)

This is of course merely a hacky workaround and by no means a proper solution, but it may be helpful.

ngudbhav commented 1 year ago

@Chentai-Kao, This worked like a charm. Thanks a lot 🎉 . What could be the implications of building a dmg this way?

LinusU commented 1 year ago

I think that the problem is that you are running appdmg under Rosetta, can you check if this is the case and try running appdmg using an arm-native version of Node instead?

SReject commented 1 year ago

Would including a check for rosetta be applicable?

Snip: Moved code to PR

Ref Links: https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment#3616845 https://stackoverflow.com/questions/65346260/get-real-architecture-of-m1-mac-regardless-of-rosetta

mncharlton commented 1 year ago

We hit this problem as well, any chance PR #223 could be looked at and merged if it fixes the issues?

SReject commented 1 year ago

For those encountering this issue while waiting for @LinusU to merge the pending PR fix, you can use a package.json override pointed to the PR fork:

{
  // rest of package.json
  "overrides": {
    "appdmg": "github:SReject/node-appdmg#872599493f64dbd192fd69adea33633a563e3a5d"
  }
}

Its fully compatible with the appdmg v0.6.6

jjeff commented 1 year ago

I've found that this error emerges when node's architecture doesn't match the machine's – usually, this means you're running x64 node on an arm64 (M1, M2) Mac.

Here's how to find out what architecture is being used for node:

node -p "process.arch"

If that says x64, you may want to reinstall node.. and probably run npm rebuild to update any native modules. That fixed the problem for me.

zepang commented 1 year ago

These below may help:

  1. check the version of node, it is recommended to use the version 16 or 16 or above
  2. if node -p process.arch outputs x64, we suggest reinstalling node or changing to a newer version, my current version is 16.14.2, which is ok.