Node js Error in Express lib/node_modules/bcrypt/bcrypt.js
Node js Error in Express lib/node_modules/bcrypt/bcrypt.js
/lib64/libstdc++.so.6: version 'CXXABI_1.3.8' not found
Meta Description: Struggling with the CXXABI_1.3.8
error in Node.js while installing bcrypt
? Learn how to fix it with a simple command and get your Express app running smoothly.
If you're working with Node.js and Express, you might encounter errors while installing dependencies like bcrypt
. One common error is:
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found
This error occurs when the required version of the C++ standard library (libstdc++
) is missing or outdated. In this article, we’ll walk you through the steps to resolve this issue and successfully install bcrypt
.
When you run the command:
npm install --save bcrypt
You might see the following error:
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /path/to/bcrypt_lib.node)
This error indicates that the bcrypt
package requires a specific version of the C++ standard library (CXXABI_1.3.8
), which is not available on your system.
To resolve this issue, you need to rebuild the bcrypt
package from its source code. Here’s how you can do it:
npm rebuild bcrypt --build-from-source
This command rebuilds the bcrypt
package using the available C++ libraries on your system.
The bcrypt
package is a native module, meaning it relies on system-level libraries like libstdc++
. If your system has an outdated version of these libraries, the installation will fail. Rebuilding the package ensures compatibility with your system’s libraries.
If the above solution doesn’t work, consider the following alternatives:
libstdc++
:
Upgrade your system’s C++ standard library to a version that includes CXXABI_1.3.8
.
For example, on Ubuntu, you can run:
sudo apt-get update
sudo apt-get install libstdc++6
bcrypt
. Install it using:
npm install bcryptjs
Note: bcryptjs
is a JavaScript implementation of bcrypt
and doesn’t require native compilation.
The CXXABI_1.3.8
error in Node.js is a common issue when installing native modules like bcrypt
. By rebuilding the package from source or updating your system libraries, you can resolve this error and continue developing your Express application.
If you found this guide helpful, share it with your peers and leave a comment below. For more Node.js and Express tutorials, subscribe to our newsletter!