AndrewVT
AndrewVT

Reputation: 335

node.js & pdfjs 'Unknown file open flag'

I have pdfjs installed running on node.js started with nohup. I am able to start node fine and port 81 is open in the firewall. As soon as I attempt to go to it in the browser it logs the following error in the nohup.out log and node.js stops. The crazy bit is that I have this working on a temporary server that was created from an image of this one to insulate the live server while a worked all this out. Now I can't seem to replicate the success I had. I can supply the code from specific files if it would be helpful, just let me know which ones.

Server running at http://mydomain.com:81/

fs.js:186
      throw new Error('Unknown file open flag: ' + flag);
            ^
Error: Unknown file open flag: rs
    at stringToFlags (fs.js:186:13)
    at Object.open (fs.js:224:44)
    at new <anonymous> (fs.js:1062:6)
    at Object.createReadStream (fs.js:1010:10)
    at serveRequestedFile (/var/path/to/tools/pdfjs/test/webserver.js:211:23)
    at Object.statFile [as oncomplete] (/var/path/to/tools/pdfjs/test/webserver.js:157:7)

Upvotes: 1

Views: 740

Answers (1)

AndrewVT
AndrewVT

Reputation: 335

Solved: Reinstalling node.js was the solution. If people encounter this error, it is likely that node either isn't installed or wasn't installed successfully. Try installing/reinstalling to correct.

Upvotes: 1

Related Questions