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

Not working on Apple Silicon #361

Open
boyanraichev opened this issue Jan 27, 2021 · 23 comments · May be fixed by #441
Open

Not working on Apple Silicon #361

boyanraichev opened this issue Jan 27, 2021 · 23 comments · May be fixed by #441

Comments

@boyanraichev
Copy link

boyanraichev commented Jan 27, 2021

Trying to send a notification on an M1 MacBook produces an error:

Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:416:11)
    at spawn (node:child_process:619:9)
    at Object.execFile (node:child_process:262:17)
    at Object.module.exports.fileCommandJson (/blah/blah/node_modules/node-notifier/lib/utils.js:83:13)

I suppose it comes down to the terminal notifier not having a native M1 build? I am not using Rosetta.

@jimblue
Copy link

jimblue commented Feb 15, 2021

Confirmed

@mikaelbr
Copy link
Owner

This is something that needs to be solved by dependency terminal-notifier I'm afraid.

@MonsieurMan
Copy link

https://github.com/julienXX/terminal-notifier did not receive any update in three years, it's unlikely they'll solve any issue. On the other hand this issue will likely gain thrust as Apple plan to migrate all of their computer to the M1 chip eventually.

@boyanraichev
Copy link
Author

isn't it only a matter of re-compiling it to support AS? terminal-notifier is listed as supporting AS in Homebrew, I am not sure if it's through Rosetta2 or native. I don't have Rosetta2 so I will install and see if it works.

@PabloC
Copy link

PabloC commented Apr 26, 2021

any idea on how to fix this?

@mikaelbr
Copy link
Owner

It might be enough to recompile terminal-notifier. I'm unable to test/fix as I don't have access to M1 at the moment. If anyone could investigate and submit PR that would be much appreciated.

@holtwick
Copy link

holtwick commented Jul 1, 2021

The easiest way is certainly to recompile. But you could probably also execute the macOS notifier tool with Rosetta like this arch -x86_64 vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier

@08-15at
Copy link

08-15at commented Jul 5, 2021

If you don't want to recompile yourself, and keep avoiding Rosetta you can also install terminal-notifier via brew and change the path in node_modules/node-notifier/notifiers/notificationcenter.js

@joeflateau
Copy link

joeflateau commented Aug 13, 2021

https://github.com/julienXX/terminal-notifier seems to be dead, https://github.com/vjeantet/alerter seems to be a reasonably active fork

alerter doesn't release m1 binaries but I was able to compile it fine on m1

@ciruz
Copy link

ciruz commented Sep 23, 2021

Hey guys,

any news on this issue? It's still not working on a M1 out of the box and @joeflateau is right, terminal-notifier looks not active at all.
The brew solution from @08-15at to avoid Rosetta works, is really good and easy, but modifying a file in node_modules/, for every project is not a real solution.

@candu
Copy link

candu commented Nov 15, 2021

Running softwareupdate --install-rosetta fixes it for me.

(I ran that as part of installing Docker as per https://docs.docker.com/desktop/mac/apple-silicon/; since that appears to be a compatibility layer for older Mac binaries, I wondered if it might also fix this problem, and it seems to!)

@maximiliansoelch
Copy link

Hi, would it be possible to update the terminal-notifier binary from the currently utilized version 1.7.2 to version 2.0.0? Besides being from 2017 and might not supporting every possible options on newer macOSs, this latest version at least runs on a M1 Mac without having to install Rosetta first.

@alloy
Copy link

alloy commented Apr 8, 2022

Hey, original author of terminal-notifier here 👋 I feel your pain, as I was wanting to use this project in a build of ours, so I'm looking into picking up maintenance myself again and publish new code-signed releases. Will report back when I have an update.

@stefansundin
Copy link

@alloy I just cloned https://github.com/julienXX/terminal-notifier and simply built it with absolutely no changes and it seems to compile fine for arm64.

Any chance of just releasing an update with no code changes just to resolve this issue?

Thanks!

$ lipo -archs ./DerivedData/Terminal\ Notifier/Build/Products/Release/terminal-notifier.app/Contents/MacOS/terminal-notifier 
x86_64 arm64

@viniciusdeliz
Copy link

Any news on this? 😅

@Alacho2
Copy link

Alacho2 commented Jun 30, 2023

I was facing the same issue and running what @candu suggested with softwareupdate --install-rosetta seems to have solved the issue for me

@KarthikeyanKanniappan
Copy link

Hi @alloy, Any Update on terminal-notifier. Is it possible to create a universal build for it

@LarryBarker
Copy link

Just want to chime in here, brand new M3 Pro, ran into this setting up an active project on the new machine. This fixed it immediately 👇 Thanks @candu !

Running softwareupdate --install-rosetta fixes it for me.

(I ran that as part of installing Docker as per https://docs.docker.com/desktop/mac/apple-silicon/; since that appears to be a compatibility layer for older Mac binaries, I wondered if it might also fix this problem, and it seems to!)

@swapneal-dev
Copy link

Running softwareupdate --install-rosetta fixes it for me.

(I ran that as part of installing Docker as per https://docs.docker.com/desktop/mac/apple-silicon/; since that appears to be a compatibility layer for older Mac binaries, I wondered if it might also fix this problem, and it seems to!)

This is fixed for me. Thanks!

@simonh1000
Copy link

Looking for a simple fix that is not rosetta - as that creates as many issues as it solves

@TrevorSayre
Copy link

TrevorSayre commented Mar 23, 2024

For now I'm using patch-package. From your project's root directory:

brew install terminal-notifier
npm i -D patch-package

Open node_modules/node-notifier/notifiers/notificationcenter.js and make the following changes and save:

-const notifier = path.join(
-  __dirname,
-  '../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier'
-);
+const notifier = '/opt/homebrew/bin/terminal-notifier';

Your path may differ, and if so simply run which terminal-notifier to find your own path to the binary file.

Then to create the patch file, run from your project's root directory:

npx patch-package node-notifier

Then update your package.json:

 "scripts": {
+  "postinstall": "patch-package"
 }

Commit everything including the new patch file and you'll be all set for future npm install thanks to the postinstall.

What's also nice is that patch-package will let you know when node-notifier has a version change to determine if you want to continue using a patch or if you can finally move off of it.

Instructions above will be slightly altered if you're using yarn, just check the patch-package docs as they're pretty easy for those adjustments.

You may also choose to not add the postinstall script and instead rename it so that it must be manually run by only those who are affected by this change. We're only using it during local development and our team are all on devices with Apple Silicon, so it works for us for now, but YMMV. This is a band-aid, but at least a convenient one for non-critical projects.

@Sebastian-Webster
Copy link

I have access to an Intel Mac and an M2 Mac without Rosetta installed and running the examples with the commands node example/macInput.js, node example/advanced.js, and node example/message.js work as expected and all tests pass on both machines with the changes in pull request #441. That pull request fixes the issues for people with Apple Silicon Macs that don't have Rosetta installed.

@chadmazilly
Copy link

Thanks for your comment @TrevorSayre this worked for me.

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.