4

I wrote an app with node.js, which uses the argon2 module for hashing passwords.

Running on my local (Windows) machine, everything was fine.

When I installed the app on my Linux server, I had errors installing the modules. However, once I updated the server to Node.js v12.18.3, reinstalling the modules completed successfully.

Unfortunately, when I attempted to actually run the app, I got the following error:

>$ node app.js
internal/modules/cjs/loader.js:1187
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/{CENSORED FOR PRIVACY}/node_modules/argon2/lib/binding/napi-v3/argon2.node)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1187:18)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/{CENSORED FOR PRIVACY}/node_modules/argon2/argon2.js:9:56)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/{CENSORED FOR PRIVACY}/models/Users.js:2:16)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)

Any ideas how to fix this?

I tried running:

LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

as suggested here, but it did not help.

Inkbug
  • 1,682
  • 1
  • 10
  • 26
  • Does this answer your question? [/usr/lib/x86\_64-linux-gnu/libstdc++.so.6: version CXXABI\_1.3.8' not found](https://stackoverflow.com/questions/20357033/usr-lib-x86-64-linux-gnu-libstdc-so-6-version-cxxabi-1-3-8-not-found) – Nico Haase Aug 12 '20 at 10:17
  • 2
    @NicoHaase That does look like a similar issue, but I don't know anything about GCC or stuff like that, so I would appreciate instructions tailored to someone who is just using a node module. – Inkbug Aug 12 '20 at 10:22

1 Answers1

1

I had the same problem with argon2 on CentOS 7.

Solved this like that:

yum install gmp-devel mpfr-devel libmpc-devel wget
wget https://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz
mkdir gcc-8.3.0-build
tar xf gcc-8.3.0.tar.gz
cd gcc-8.3.0-build
../gcc-8.3.0/configure --enable-languages=c,c++ --disable-multilib
make && make install
export LD_LIBRARY_PATH=/usr/local/lib64:${LD_LIBRARY_PATH}

As proposed here

To note, in my case, "make" and "make install" commands took about 2 hours to complete. And I needed them to run as a root. I think, you should export LD_LIBRARY_PATH, as shown in last step, each time you open terminal to run your node js app.

farynaa
  • 330
  • 3
  • 7