Діма Комар Діма Комар - 1 year ago 161
Node.js Question

cant create file on a server 'EPERM, operation not permitted' Node.js

I'm an iOS developer but trying to write on node.js for for 3rd day;)

so I've got my resful api working and usind https://cloudno.de to host my server, and It seems like everthing is ok, but I have this line of code in my app:

var storage = new Client.CookieFileStorage(__dirname + '/cookies/' + username + '.json');

which is generating cookie file for a user, so its woking on my localhost (I'm using macOS) but on my server I've got this error :

fs.write = function(fd, buffer, offset, length, position, callback) {
Error: EPERM, operation not permitted '/app/2773-3c06b4e3bcc357fd4400a9b453bc4af5/cookies/komar_dima.json'

Any ideas how to fix it ?

Answer Source

According to this page you are allowed to create files on /mnt and /tmp.

So change path to that paths for creating cookie files.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download