First, ensure that you have libbson and libmongocrypt installed globally (requires wget and cmake):
# Installs libbson
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.14.0/mongo-c-driver-1.14.0.tar.gz
tar xzf mongo-c-driver-1.14.0.tar.gz
cd mongo-c-driver-1.14.0
mkdir cmake-build && cd cmake-build
cmake -DENABLE_MONGOC=OFF -DCMAKE_C_FLAGS="-fPIC" ../
make -j8 install
cd ../../
# Installs libmongocrypt
git clone git@github.com:10gen/libmongocrypt.git
cd libmongocrypt
mkdir cmake-build && cd cmake-build
cmake -DCMAKE_C_FLAGS="-fPIC" ../
make -j8 install
cd ../../Now, you can run npm install:
npm install-
Ensure that you have
mongocryptdrunning atlocalhost:27020, and amongodof version 4.2.0 running atlocalhost:27017 -
Save your AWS KMS credentials to a file named
env.shin the following format:#/usr/bin/bash export KMSKID="xxxxxxxxxxxxxxxxxxxx" export KMSKEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" export KMSARN="arn:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" #
-
Run the following command
npm run demo