diff --git a/red/runtime/nodes/context/localfilesystem.js b/red/runtime/nodes/context/localfilesystem.js index 28e1c4cce..89c7e6760 100644 --- a/red/runtime/nodes/context/localfilesystem.js +++ b/red/runtime/nodes/context/localfilesystem.js @@ -143,7 +143,13 @@ LocalFileSystem.prototype.open = function(){ self.cache.set(scope,key,data[key]); }) }); - }) + }).catch(function(err){ + if(err.code == 'ENOENT') { + return fs.mkdir(self.storageBaseDir); + }else{ + return Promise.reject(err); + } + }); } else { return Promise.resolve(); }