I am learning how to write to a file using Nodejs. I tried the below posted example, but I received the below posted error
How can I fix this error?
Code:
var fs = require('fs');
fs.writeFile("c://NodeTest", "Hey there!", function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
Error:
{ [Error: EPERM: operation not permitted, open 'c:\NodeTest']
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'c:\\NodeTest' }