🐛 Fix bug with external modules on Function-Nodes

This commit is contained in:
Jan Oberhauser 2020-01-25 13:21:59 -08:00
parent 31b210f596
commit 5a2f2ee8d1
2 changed files with 2 additions and 2 deletions

View file

@ -84,7 +84,7 @@ export class Function implements INodeType {
try {
// Execute the function code
items = (await vm.run(`module.exports = async function() {${functionCode}}()`, './'));
items = (await vm.run(`module.exports = async function() {${functionCode}}()`, __dirname));
} catch (e) {
return Promise.reject(e);
}

View file

@ -90,7 +90,7 @@ export class FunctionItem implements INodeType {
let jsonData: IDataObject;
try {
// Execute the function code
jsonData = await vm.run(`module.exports = async function() {${functionCode}}()`, './');
jsonData = await vm.run(`module.exports = async function() {${functionCode}}()`, __dirname);
} catch (e) {
return Promise.reject(e);
}