Closed Jinwei1987 closed 2 years ago
@Jinwei1987 Does SoftHSM works fine on your computer? What is your NodeJS architecture?
As I can see the problem is in architecture difference for pkcs11js
lib and softhsm lib. Maybe you need to install SoftHSM with the same architecture that NodeJS use or reinstall NodeJS and rebuild native modules
@microshine I install SoftHSM via brew, and from the error SoftHSM looks correct, which is arm64 architecture. In terms of node, I use 14.18.3, from the official website I don't see it distinguish x86 from arm64 for package installation.
@microshine I have got the problem solved with node 16.13.2. Looks like it is some compatible issue with old version of nodejs.
when loading softhsm lib on arm64 mac, there is an error: dlopen(/opt/homebrew/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so, 0x0006): tried: '/opt/homebrew/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libsofthsm2.so' (no such file), '/usr/lib/libsofthsm2.so' (no such file)