kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

Error: Preprocessing failed. (env: babel: No such file or directory ) #295

Open okgolove opened 2 years ago

okgolove commented 2 years ago
#!/usr/bin/env babel

function bindLaunch(key, modifiers, appName) {
    Key.on(key, modifiers, function () {
        App.launch(appName).focus()
    });
}

bindLaunch("c", ["ctrl", "cmd"], "Safari")

Babel is installed

➜ /usr/bin/env babel
babel:
  stdin compilation requires either -f/--filename [filename] or --no-babelrc
~
➜ which babel
/opt/homebrew/bin/babel

If I set shebang #!/opt/homebrew/bin/babel I recieve Error: Preprocessing failed. (env: node: No such file or directory ).

kasper commented 2 years ago

Hey! 👋 Can you try #!/usr/bin/env babel --no-babelrc? Moreover, do you need Babel? macOS 12 supports modern JavaScript.

okgolove commented 2 years ago

Unfortunately does not help. Yes, it works without preprocessing via babel but I'd say it's faster with preprocessing.

kasper commented 2 years ago

@okgolove Hey! I tested this out and it works for me with #!/usr/bin/env babel, but I have the old Homebrew install location. /usr/local/bin is automatically appended to the env, so what I think is happening here is that /opt/homebrew/bin is not part of your PATH and Phoenix cannot find your binaries?

~ % which babel
/usr/local/bin/babel