Fallback to 'require' if on node < 12.17

This commit is contained in:
Nick O'Leary
2021-07-15 15:37:12 +01:00
parent 31c5d6e1c1
commit 66a704af55
2 changed files with 19 additions and 1 deletions

View File

@@ -494,7 +494,7 @@ module.exports = function(RED) {
node.error(err);
}
}).catch(err => {
throw new Error(RED._("function.error.externalModuleLoadError"));
node.error(RED._("function.error.externalModuleLoadError"));
});
}
RED.nodes.registerType("function",FunctionNode, {