ENOENT error using nodejs on heroku - node.js

I'm getting an ENOENT error on my heroku app, preventing it from starting up:
Error: ENOENT, open '/app/log/production.log'
This file / dir (app/log) does exist however...
So I'm not sure what's going on?

I ended up disabling 'quiet' mode to stop writing logs to disk:
app.disable('quiet');
This seems to of resolved it

Related

ENOENT on writeFileSync works on repl fails on gulp-asset-manifest

I'm using the code on this site to write a gulp file for a Windows aspnet + angularjs app.
I'm running only styles for now, and when I run gulp I get:
Error: ENOENT, no such file or directory 'C:\project\build\manifest-debug.json'
at Error (native)
at Object.fs.openSync (fs.js:502:18)
at Object.fs.writeFileSync (fs.js:1103:15)
at writeManifestFile (C:\project\node_modules\gulp-asset-manifest\index.js:30:8)
at resetManifestFile (C:\project\node_modules\gulp-asset-manifest\index.js:51:5)
at module.exports (C:\project\node_modules\gulp-asset-manifest\index.js:76:5)
at getManifest (C:\project\Gulpfile.js:97:12)
at Gulp.<anonymous> (C:\project\Gulpfile.js:126:15)
at module.exports (C:\project\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (C:\project\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
Looking at C:\project\node_modules\gulp-asset-manifest\index.js:30:8 I see:
fs.writeFileSync(filename, JSON.stringify(data));
So I ran this on node's REPL:
fs.writeFileSync('C:\\project\\build\\manifest-debug.json', 'hi');
And the file was created correctly.
I tried running gulp again with an existing file and got the exact same error.
I added a console.log(filename); before line 30 on index.js and I got:
./build/manifest-debug.json
So I ran fs.writeFileSync('./build/manifest-debug.json', 'hi'); on REPL from the same folder and it worked too.
Not sure what's going on.
I'm running everything with UAC disabled and on a command prompt with admin rights.
The problem was fs.writeFileSync requires the path to exist.
At the point gulp-asset-manifest was called ./build was nonexistent, because the clean task deleted the entire path.

Can't deploy to firebase . Get ENOENT error

Every time i run firebase deploy i get the following error
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open '/home/joseph/tmp/11484-12736-1f3kttw.tar.gz'
Any ideas on what could be causing it?
Apparently adding an empty tmp directory to the home folder fixed the issue. Running the command as root doesn't create the directory itself.
The question has inadequate details but it seems that the file /home/joseph/tmp/11484-12736-1f3kttw.tar.gz either doesn't exists or it isn't accessible by your running application.
sudo firebase deploy
That should do it!

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)
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.

node.js express-coffee Error: ENOENT, no such file or directory

I installed the latest express-coffee and installed node-config too. I created a simple src/config/default.yaml
Database:
db_host: localhost
db_name: test
In my src/models/index.coffee
config = require('config').Database
console.log "host: #{config.db_host}"
But when trying to start the server with cake dev or even cake build && node app I am getting the following error:
Cannot write runtime.json file Error: ENOENT, no such file or directory
Tried searching for the issue here and on Google but wasn't able to find anything. Even the few hits on just ENOENT or node-config runtime.json haven't been helpful. Anyone else run into this problem before ?
It turns out the problem was where config/default.yaml was located. I had to move this to the root directory of the application. Moving it to the root - config/default.yaml fixed the issue.
The error message wasn't very helpful in figuring out what was going on.

Change to STDOUT logging on nodejs app

Following on from this:
ENOENT error using nodejs on heroku
I've been suggested to use STDOUT logging on my node.js app...?
Is this possible?
If so, how / where do I configure this?
Related to:
ENOENT error using nodejs on heroku
I ended up disabling 'quiet' mode to stop writing logs to disk:
app.disable('quiet');
This seems to of resolved it

Resources