Copy link to clipboard
Copied
I'm trying to write some scripts to automate a build process and I can't seem to get exportToJSXBin.js working! It keeps giving me this:
node:internal/modules/cjs/loader:1289
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: dlopen(/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node, 1): no suitable image found. Did find:
/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node: mach-o, but wrong architecture
/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node: mach-o, but wrong architecture
at Module._extensions..node (node:internal/modules/cjs/loader:1289:18)
at Module.load (node:internal/modules/cjs/loader:1068:32)
at Module._load (node:internal/modules/cjs/loader:909:12)
at Module.require (node:internal/modules/cjs/loader:1092:19)
at require (node:internal/modules/cjs/helpers:103:18)
at GetCoreLib (/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/public-scripts/exportToJSXBin.js:28:24)
at initializeCore (/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/public-scripts/exportToJSXBin.js:250:20)
at Object.<anonymous> (/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/public-scripts/exportToJSXBin.js:273:1)
at Module._compile (node:internal/modules/cjs/loader:1205:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1259:10) {
code: 'ERR_DLOPEN_FAILED'
}
There are a bunch of solutions suggested for similar errors on other tools, I tried a couple and no joy and frankly some of the others look a bit heavy handed and I'm worried I might do something I'll regret. Anyone experienced this with VS Code ExtendScript?
@tommyc71769282 Could you also try using the file command on your Node executable?
On my machine (M1 Max) I installed Node with NVM so I had to do the following:
# cd ~/.nvm/versions/node/v16.13.0/bin
# file node
And that resulted in the following output:
# node: Mach-O 64-bit executable x86_64
This shows that my v16.13.0 installation of NodeJS is the Intel-only build. Universal binaries would result in something like this:
# node: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit e
...
Copy link to clipboard
Copied
Is this on Apple Silicon?
Copy link to clipboard
Copied
Yes, MacBook Pro M1, Big Sur (although I do also have another MacBook on Monterey).
Copy link to clipboard
Copied
Hey, are you on an M1 chip?
Copy link to clipboard
Copied
Hi Malcolm. It's Tommy. Long time! How are you?
I'm on a MacBook Pro M1, Big Sur (although I do also have another MacBook on Monterey).
Copy link to clipboard
Copied
Hey, Doing alright, thought it was you but didn't want to presume, I was going to point you in the direction of @Harbs. answer, so make sure and give him the kudos.
Copy link to clipboard
Copied
I wanted to respond with a laughing emoji, but I've never figured out these forums. I still remember fondly when we could particiapte by email... 😉
Copy link to clipboard
Copied
Copy link to clipboard
Copied
@ErinFWe used to be able to subscribe to specific forums by email as a first-class client. I had a number of filters which grouped forum discussions into folders on my computer. This was for *all* discussions whether or not I participated. If that works, I'd likely participate more than I currently do.
Copy link to clipboard
Copied
ah those where the days, 😄
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I am running VS Code in Rosetta mode. It works fine in general but the exportToJSXBin.js script generates this error when I try to run it from Terminal.
Copy link to clipboard
Copied
The shell script would need to be run in Rosetta too.
Copy link to clipboard
Copied
The error you're reporting suggests that it is not being run under Rosetta 2:
node:internal/modules/cjs/loader:1289
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: dlopen(/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node, 1): no suitable image found. Did find:
/Users/TCallan/.vscode/extensions/adobe.extendscript-debug-2.0.3/lib/esdebugger-core/mac/esdcorelibinterface.node: mach-o, but wrong architecture
That "mach-o, but wrong architecture" bit is a strong indicator that you're not actually running VS Code in Intel mode.
You might try running your code (VS Code command line binary) instance by prefixing the command with "arch -x86_64".
Copy link to clipboard
Copied
Still no joy I'm afraid. I'm definitely running VS Code and Terminal in Rosetta, still get the same error as above. I have also tried arch -x86_64 and that gives me another error: arch: posix_spawnp: node: Bad CPU type in executable
Tried running softwareupdate --install-rosetta to fix that and still the same result...
Copy link to clipboard
Copied
@tommyc71769282 What is the specific command that you're using to start NodeJS? Additionally, how did you install NodeJS? Can you confirm that you have a Universal build of NodeJS installed or have otherwise installed the Intel version?
Copy link to clipboard
Copied
@tommyc71769282 Could you also try using the file command on your Node executable?
On my machine (M1 Max) I installed Node with NVM so I had to do the following:
# cd ~/.nvm/versions/node/v16.13.0/bin
# file node
And that resulted in the following output:
# node: Mach-O 64-bit executable x86_64
This shows that my v16.13.0 installation of NodeJS is the Intel-only build. Universal binaries would result in something like this:
# node: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]
# node (for architecture x86_64): Mach-O 64-bit executable x86_64
# node (for architecture arm64): Mach-O 64-bit executable arm64
Can you please try running that file command on your node binary to see what version(s) it was compiled for?
Copy link to clipboard
Copied
@sberic this seems to have done the trick! I had always installed node with nvm but I could not get it to install a universal binary at all no matter what I tried. I could however get it to install an older x86_64 version as well as my arm64 versions and I can use nvm use in my script to explicitly run exportToJSXBin.js via that version of node. Thanks for your help, much appreciated!