GovTechSG/purple-a11y

ERR_DLOPEN_FAILED

mgifford opened this issue · 4 comments

From /purple-hats-portable-mac-arm64/purple-hats when I run $ node index I get the following error. 

node:internal/modules/cjs/loader:1243
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^
Error: dlopen(/Users/mgifford/node_modules/canvas/build/Release/canvas.node, 0x0001): tried: '/Users/mgifford/node_modules/canvas/build/Release/canvas.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/mgifford/node_modules/canvas/build/Release/canvas.node' (no such file), '/Users/mgifford/node_modules/canvas/build/Release/canvas.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
    at Module._extensions..node (node:internal/modules/cjs/loader:1243:18)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Users/mgifford/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12) {
  code: 'ERR_DLOPEN_FAILED'
}


Node.js v18.12.1
bash-3.2$

Hi @mgifford,

Would you like to try the latest Portable release at purple-hats-portable-mac.zip? Portable Purple hats takes care of all the dependencies required, including node.

However, if you intend to run Purple hats with your own download of Node, ensure you have the arm64 tar.gz release of node for M1-based MacBook, and x64 tar.gz release of node for Intel-based MacBook.

Just downloaded the latest one on my M1 Max chip.

purple-hats % pwd
/Users/mgifford/purple-hats-portable-mac/purple-hats
purple-hats % node index
purple-hats %

That didn't return any results. Just a new command prompt.

Thanks @younglim

Hi @mgifford

Have you taken a look at the step-by-step Installation Guide?

Essentially, within the portable-purple-hats-mac folder (the same location as your Terminal's output), run:

source hats_shell.sh

hats_shell.sh prepares your Terminal environment.

You can then run purple hats:

cd purple-hats
node index

If purple-hats does not run, would you be able to share your MacOS version (e.g. macOS Monterey 11.6.3) for me to troubleshoot?

Hi @mgifford,

I have closed this issue due to inactivity. I hope the above suggestions resolve the issue you have encountered.