nodejs newrelic throws Error: EACCES, open '/newrelic_agent.log' - node.js

I just tried to get newrelic tracking on my node app working (http://newrelic.com/nodejs), however I get the following error:
events.js:72
throw er; // Unhandled 'error' event
^
Error: EACCES, open '/newrelic_agent.log'
According to newrelic node is logging to the same directory. However this seems to me that it is trying to log to the root directory?!
Manually creating the file in the server root works. However this isn't what I like to do. Is this a bug?
How can I set the log path?

You can change your log path in your newrelic.js configuration file.
logging : {
filepath : 'log_path_here'
}
Or
You can set the log path with an environment variable. You an use the NEW_RELIC_LOG environment variable.
Environment variables override settings made in the newrelic.js config file.

Related

TypeError when generating angular-fullstack service?

I'm receiving the following TypeError when trying to generate an angular-fullstack service.
Does anyone know why this is happening?
Here is my terminal window:
Justins-MacBook-Pro-2:epbWebApp Justin$ yo angular-fullstack:service
? What module name would you like to use? epbWebAppApp.event
? Where would you like to create this service? event
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:1213:7)
at /Users/Justin/npm/lib/node_modules/generator-angular-fullstack/node_modules/generator-ng-component/service/index.js:28:21
DUH! I re-read the documentation and I simply forgot that you must specify a name for the service in the initial command.
I typed the first command as follows, and it worked!
yo angular-fullstack:service [NAME]
Then I was able to specify module name and location in the following two prompts.

Images not loading immediately after uploading in sails.js when app is running on production environment

I have uploaded and stored images in /assets/images/path/to/image . All was fine in development environment. But when I run my app in production environment first got problem that Images not showing immediately after uploading. But can view the image after restart the server by sails lift.
I searched for solution and got the idea to copy the same uploaded file in /.tmp folder to Immediately access the uploaded image. So I try this solution and use following code to copy the images in .tmp folder...
var tempLocation = process.cwd()+ '/.tmp/public/images/custom/path/to/image';
fs.createReadStream(uploadLocation).pipe(fs.createWriteStream(tempLocation));
But then I got error when writing in .tmp
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open path/to/.tmp/folder;
I have grunt installed both globally and locally. So don't think it is a problem. Please help me to solve this problem. Thanks

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.

Iin meteor deploy server Error: ENOENT, no such file or directory

in my meteor application I am using node fs to write the file, but when I deployed my application at meteor.com server then I am getting error in meteor logs.
WARNING Error: ENOENT, no such file or directory 'testaudio/server/uploads/6_40_16_340.pcm'
at Object.fs.openSync (fs.js:432:18)
fs = Meteor.npmRequire('node-fs'); in my server and i mentioned the version in packags.json
I am writting file inside /server/uploads/file_name in my application.
I dont know why I am unable to write the file at server. event I tried with full path by using
fullPath = meteor_bootstrap.serverDir that gives path like :-
/appDir/.meteor/local/build/programs/server

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!

Resources