"Could not find an executable for process" when file is clearly there

I’m writing an LSP extension, and I want to bundle the language server and everything it needs so that the user doesn’t have to manually install anything extra. I took inspiration from nova-rust which uses a shell script inside a Process to download and update its bundled language server when needed. I created this function to update the server and start it when it finishes:

function updateBundles(server) {
	serverPath = nova.config.get("com.johnlindop.nova-typescript.language-server-path")
	arguments = []
	if (nova.inDevMode) {
	if (!nova.config.get("com.johnlindop.nova-typescript.language-server-path")) {
	if (nova.config.get("com.johnlindop.nova-typescript.install-fallback-typescript")) {
	let updater = new Process(`${binPath}/update_language_server.sh`,
			cwd: `${nova.extension.path}/bin`,
			shell: '/usr/bin/env zsh',
			args: arguments
	updater.onDidExit(function(exitCode) {
		console.log("Starting language server")

However, when I run the function, it fails with the following error:

Error: Could not find an executable for process: /Users/john/git/Nova Typescript.novaextension/bin/update_language_server.sh
    @[native code]

If I run the script from my terminal using that exact path, it works perfectly. I’ve declared the process, requests and `filesystem: readwrite" entitlements, so the extension should be able to download what it needs?

Just wondering if the space in the path is causing an issue. You may want to try something like:

nova.path.join(binPath, "update_language_server.sh")

That didn’t seem to work. I also tried renaming the .novaextension folder to not include a space.

After looking into the implementation of nova-rust, it turns out that you can define the path to the executable relative to the Process cwd, instead of as absolute. This fixed the problem for me.

let updater = new Process(("./update_language_server.sh"),
			cwd: binPath,
			shell: true,
			args: arguments