Getting error while reading local file in node.js -
i trying read local file using node.js. npm module trying execute child process , inturn opens file read. while reading throws error
{ [error: enoent, open 'e:\project\secintegrator\attack\manifest.json'] errno: 34, code: 'enoent', path: 'e:\\project\\secintegrator\\attack\\manifest.json' }
actual path read file
e:\project\secintegrator\node_modules\restscannerdriver\garudrudra\attack\manifest.json
i have used var configpath = path.join(path.dirname(fs.realpathsync(__filename)), '/');
calculate absolute path still not working.
inside npm module path changes. try use __dirname in npm , create realpath that:
var filepath = fs.realpathsync(__dirname+'/'+relative path here file);
after what's result of filepath
Comments
Post a Comment