Nodejs npm Module require Error

#1

I have installed dreamfactory on Azure using the bitnami image. I am creating a service using nodejs. When I am trying to call lodash it gives me error. Even though the files are present in the storage/scripting directory. Anything else I am missing?

Error
image

Files
image

Code
image

#2

Ok I have found the answer. This works

image

#3

@navjinder

In your screenshot:

image

The NPM module you’ve required is ‘loadash’, I think const lodash = require('lodash') should be sufficient. I don’t think you need to require the full path. It’s also important to remember to use the -g flag when installing modules to use in DF server side scripts. At least this has been my observation.

#4

@Sasquatch oh that makes perfect sense. I will try that.