This guide outlines solutions to common issues encountered during Rocket.Chat development setup. If your problem persists, further investigation may be required to identify the root cause.
General troubleshooting
Resolve a missing babel-runtime npm Package
If you see an error similar to the following:
(STDERR) Error: The babel-runtime npm package could not be found in your node_modules
(STDERR) directory. Please run the following command to install it:
(STDERR)
(STDERR) meteor npm install --save babel-runtime
(STDERR)
(...)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.Install the missing package using the command below:
meteor npm install --save babel-runtimeResolve slower JavaScript implementation of bcrypt
bcryptIf you see a warning similar to the following in the meteor logs:
(STDERR) Note: you are using a pure-JavaScript implementation of bcrypt.
(STDERR) While this implementation will work correctly, it is known to be
(STDERR) approximately three times slower than the native implementation.
(STDERR) In order to use the native implementation instead, run
(STDERR)
(STDERR) meteor npm install --save bcrypt
(STDERR)Cause: The native bcrypt library is not installed. Meteor falls back to a pure JavaScript implementation, which is significantly slower.
Solution: Install the native library:
meteor npm install --save bcryptPython version not supported by node-gyp
node-gypIf you encounter an error similar to the following:
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/usr/local/bin/python3" is v3.5.2, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.Cause: The Python version configured for npm is not supported by node-gyp.
Supported versions:
>= 2.5.0
< 3.0.0
Solution: If a compatible Python version is installed, configure it with:
meteor npm config set python python2.7Then rebuild the project:
meteor npm install --save bcryptVerify the installation by confirming output similar to the following:
> node-gyp rebuild
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/bcrypt_lib.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9
Rocket.Chat@0.46.0-develop /Users/douglas/work/github/Rocket.Chat
└─┬ bcrypt@0.8.7
├── bindings@1.2.1
└── nan@2.3.5libcuda.so.1 is not a symbolic link
libcuda.so.1 is not a symbolic linkPlease follow these steps if you encounter the error message, “/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link” while building your Rocket.Chat project.
Open a terminal and check the status of the
libcuda.so.1file by running:ls -l /usr/lib/wsl/lib/libcuda.so.1If the output shows this:
-r-xr-xr-x 1 root root 154088 Dec 19 2023 /usr/lib/wsl/lib/libcuda.so.1This means the
libcuda.so.1file exists but is not a symbolic link, as indicated by the file permissions and type (-r-xr-xr-xindicates a regular file, not a symbolic link). To resolve this issue, remove this file and create a symbolic link pointing to the correctlibcuda.sofile.Remove
libcuda.so.1file:sudo rm /usr/lib/wsl/lib/libcuda.so.1Check for the actual
libcudafiles in the directory to determine the correct target for the symbolic link:ls -l /usr/lib/wsl/lib/Look for the actual
libcudafiles, such aslibcuda.so.1.1.Create a symbolic link, assuming
libcuda.so.1.1is the correct target file:sudo ln -s /usr/lib/wsl/lib/libcuda.so.1.1 /usr/lib/wsl/lib/libcuda.so.1Verify the symbolic link is set up correctly:
ls -l /usr/lib/wsl/lib/libcuda.so.1The output should show that
libcuda.so.1is a symbolic link pointing tolibcuda.so.1.1(or another appropriate version):lrwxrwxrwx 1 root root 31 Jun 24 19:04 /usr/lib/wsl/lib/libcuda.so.1 -> /usr/lib/wsl/lib/libcuda.so.1.1Clean Yarn cache:
yarn cache cleanInstall dependencies and build the project:
yarn yarn dsv
Windows troubleshooting
exit 139 segmentation fault in WSL
exit 139 segmentation fault in WSLThis error is typically caused by insufficient memory or CPU resources allocated to WSL, which can lead to segmentation faults during the build process. You can resolve it by following these steps:
Allocate more memory and CPU cores by editing the
.wslconfigfile. To do this:Open the Windows Run dialog (
Win + R) and run:
notepad %UserProfile%\.wslconfigYou can replace
notepadwithcodeto use Visual Studio Code.If the file does not exist, create it.
Add or update the following configuration:
[wsl2]
memory=4GB # Increase to 8GB or more if available
processors=2 # Adjust based on your systemAfter saving the file, restart WSL to apply the changes:
wsl --shutdownThen launch your WSL distribution again.
Corrupted local build files can sometimes trigger segmentation faults.
cd Rocket.Chat/apps/meteor
rm -rf .meteor/localClean the project and rebuild:
cd Rocket.Chat
rm -rf node_modules
yarn cache clean
yarn
yarn dsvIf the error persists, try allocating at least 8GB of memory to WSL.
MacOS troubleshooting
permission denied error when running yarn on macOS
permission denied error when running yarn on macOSThis error typically occurs when the current user lacks write permissions for the Yarn cache directory (~/.yarn).
Confirm the error resembles:
EACCES: permission deniedRun the following commands to restore ownership and write access:
sudo chown -R $(whoami) ~/.yarn
sudo chmod -R u+w ~/.yarnFixing fibers build failure on Apple Silicon (M1/M2/M3)
fibers build failure on Apple Silicon (M1/M2/M3)If yarn fails during the fibers linking step with an error similar to:
YN0009: fibers@npm:5.0.3 couldn't be built successfully (exit code 1)
node-gypintroduced breaking changes in v10.0.0 and supports Node.js^16.14.0 || >=18.0.0. If you encounter Node version compatibility issues, installnode-gyp@9.4.1or earlier.See the release notes for more details.
Rebuild
fibersfor the ARM64 architecture:
cd node_modules/fibers
node-gyp rebuild --arch=arm64Depending on your
node-gypversion, the deprecateddistutilspackage may be required.Since
distutilswas removed in Python 3.12+, use an earlier Python version if you encounter related errors.
Copy the compiled binary to the expected location:
mkdir bin/darwin-arm64-83
cp build/Release/fibers.node bin/darwin-arm64-83/fibers.nodeReplace the existing module inside Meteor:
cd ../..
rm -rf apps/meteor/node_modules/fibers/
cp -r node_modules/fibers apps/meteor/node_modules/Complete the setup. Follow the instructions for resolving the bcrypt issue, even if the error has not yet appeared, to prevent additional build failures.
Fixing bcrypt architecture mismatch on Apple Silicon
bcrypt architecture mismatch on Apple SiliconIf you encounter an error similar to the following:
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')),
'/usr/local/lib/bcrypt_lib.node' (no such file)Navigate to the
bcryptdirectory and rebuild the binary:
cd node_modules/bcrypt
makeThis compiles the module for your system’s architecture.
After rebuilding, copy the updated module into the Meteor project:
cd ../..
rm -rf apps/meteor/node_modules/bcrypt
cp -r node_modules/bcrypt apps/meteor/node_modules/Fixing yarn dsv failure caused by the sharp module (Apple Silicon)
yarn dsv failure caused by the sharp module (Apple Silicon)If yarn dsv fails with an error similar to “Something went wrong installing the 'sharp' module”
this typically indicates an Apple Silicon compatibility issue. The sharp module, used for image processing in Rocket.Chat, cannot locate the required native binary (sharp-darwin-arm64v8.node).
Follow the steps below to resolve the issue:
Run the following command to install Rosetta 2, which enables x86_64 binaries to run on Apple Silicon:
softwareupdate --install-rosettaRemove the existing Meteor installation:
sudo rm /usr/local/bin/meteor
rm -rf ~/.meteorThis ensures that any incompatible binaries are fully removed before reinstalling.
Reinstall Meteor using x86_64 architecture:
arch -x86_64 npm install -g meteorInstalling Meteor under x86_64 allows native modules like sharp to compile correctly.
Rebuild the project:
yarn && yarn build && yarn dsvOnce the process completes successfully, the application should be available at:
http://localhost:3000bcrypt fails with an “incompatible architecture” error after running yarn dsv (Apple Silicon)
bcrypt fails with an “incompatible architecture” error after running yarn dsv (Apple Silicon)If you encounter an error similar to the following:
(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))After reinstalling, rerun your project to confirm the issue is resolved.