Custom service scripting


I have tried the Example given in

and I invoked this request through postman Chrome Extension. please find the details below.

Custom Code:

var lodash = require(“lodash.min.js”);

if (event.request.method !== “GET”) {
throw(“Only HTTP GET is allowed on this endpoint.”);

var params = event.request.parameters;

// check for required params
var required = [“n1”,“n2”];
lodash._.each( required, function( element ) {
if (!params.hasOwnProperty(element) || !params[element]) {
throw( “Missing '” + element + “’ in params\n” );

var result = Number(params.n1) + Number(params.n2);
return result;

Requested URL:

I get the following response.
“error”: {
“context”: null,
“message”: “The module “lodash” could not be found in any known locations.”,
“code”: 500,

I checked the Dream Factory logs i found the following.

[2015-11-26 19:13:09] local.DEBUG: Service event: add.get.pre_process

[2015-11-26 19:13:09] local.DEBUG: * no “require()” support in V8 library v3.17.15

Please help me about how to resolve this

K R Sreenivas Harshith.

I am also having the same issue!

Hi guys! Did you fix the problem? Having the same here…

V8 scripting was previously not supported in the Windows Bitnami builds.

With the release of DreamFactory 2.0.3, we have been able to add this feature back into the Windows build. To use it, you will have to install this new stack.

Actually I overlooked the original question, didn’t know it was about Windows. I just started a new instance based on Bitnami image and everything works well now.

Many thanks!

1 Like