'Can't instantiate Realm module on realm-function

I am not able to instantiate Realm:

exports = function(arg){
      const Realm = require("realm");
      const appConfig = {
          id: "realmapp-id",
          timeout: 1000,
          app: {
              name: "realmapp",
              version: "1"
          }
        };
      let app = new Realm.App(appConfig);
};

I get this error:

Cannot find module 'realm'

This example code comes from their website. Is it outdated? Or something else?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source