I have a function that should open a directory after it was created,
setTimeout(function()
{
var fs = require('fs');
console.log(newPath);
var open = fs.opensync(newPath, 'r');
}, 2500);
But this doesn't seem to work. I am getting the following errors
first is,
TypeError: undefined is not a function at eval (eval at
<anonymous>
(file:///Users/proslav/Library/Developer/Xcode/DerivedData/trackingCore-ecxfviftqracjxhimcuhhhvyddso/Build/Products/Debug/trackingCore.app/Contents/Resources/timeBroFront.app/Contents/Resources/app.nw/js/jquery-1.10.2.min.js:3:4994), :43:18)
and second is,
Uncaught ReferenceError: require is not defined
I was thinking that it could be that my variable newpath
is undefinded but the log shows me the right link.
The creation of the directory with var fs = require('fs');
works fine.
What am I doing wrong here?