Strongloop error in slc loopback command - node.js

I've installed Strongloop in my Digital Ocean droplet, but when I try to begin a project with slc loopback this error appears:
events.js:72
throw er; // Unhandled 'error' event
^
Error: EACCES, open '/home/cae/apps/easylearn/package.json'
I've searched for this error or similar ones, but until now couldn't find anything...
Any tips?

EACCES errors typically have to do with bad file/directory permissions. Correct the permissions and the problem should go away.

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.

nodemon is not restarting the server when using node-java package

When using node-java package, nodemon doesn't restart when the files change. If I remove node-java package then nodemon will restart when there are file changes.
Even the manual restart (rs) is not working when using node-java package in server. Following is the behavior.
alon
And even it throws the following:
events.js:85
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1156:14)
at listen (net.js:1182:10)
at Server.listen (net.js:1267:5)
Since the port 4000 is being used only once in server and no where else, its behaving weird.
It seems that node-java somehow magically 'overrides' what's happening when receiving SIGUSR2 signal. In such a case, the SIGUSR2 signal (used by nodemon) to restart the app may fail terminating the app.
(Quick) Fix:
after the node-java has screwed your SIGUSR2 handling mechanism, add the following snippet of code:
process.once('SIGUSR2', function() {
process.kill(process.pid, 'SIGUSR2')
})
note that you must do this AFTER the node-java (or something which uses it, in my case it is node-tika) does its 'job' (in my case, immediately after requiring node-tika).
To be honest, I have only very little understanding, why this works and I'll be glad if someone can shed more light on this.
You can try running this command.
nodemon --signal SIGINT ./index.js

Error running grunt/starting server.js

For some quick background, I am following a MEANio tutorial found here. Now, I am at the part where I have run mean init, it has finished, and then cd into the project directory and run
npm install
After fixing a brief JSON syntax issue inside package.json (the end of the file was slightly mis-typed), I attempted to run
grunt
Hook task, clean, jshint, and csslint all ran fine, and then when I get to the portion of the build script that runs
node --debug server.js
I run into errors
events.js:72
throw er; // Unhandled 'error' event
Error: listen EADDRNOTAVAIL
at errnoException (net.js:905:11)
at Server._listen2 (net.js:1024:19)
at listen (net.js:1065:10)
at net.js:1147:9
at asyncCallback (dns.js:68:16)
at Object.onanswer [as oncomplete] (dns.js:121:9)
[nodemon] app crashed - waiting for file changes before starting...
I am pretty clueless about the inner workings of Node, does anyone know what this error refers to? I followed the MEANio tutorial nearly exactly, with the exception of where my node is at, I just have it in a folder that I have added to my $PATH in my .bashrc file. Could someone give me some advice on what files to check/debug?
The EADDRNOTAVAIL error typically occurs when you are trying to run a server on a port that is already in use. That tutorial suggests that the port would be 3000 (which is a typical default for Node applications). You should check to see that you do not have anything else running on port 3000 already.

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!

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

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.

Resources