Sane-Cli sane up EPERM Error: Server not Starting - node.js

I am using sane-cli in an ember app and when I try to use sane up inside the sails folder. I am getting this error. Can anyone help me to fix it?
I have already tried sudo npm install inside the server folder and globally.
Error log (image):
client | Could not start watchman
client | was unable to use: "events", fell back to: "polling"
server | debug: initializing sails-hook-dev...
server | events.js:160
server | throw er; // Unhandled 'error' event
server | ^
server |
server | Error: watch /home/ayush/Code/sails/server/api/blueprints EPERM
server | at exports._errnoException (util.js:1018:11)
server | at FSWatcher.start (fs.js:1443:19)
server | at Object.fs.watch (fs.js:1470:11)
server | at createFsWatchInstance
(/home/ayush/Code/sails/server/node_modules/chokidar/lib/nodefs-
handler.js:37:15)
server | at setFsWatchListener
(/home/ayush/Code/sails/server/node_modules/chokidar/lib/nodefs-
handler.js:80:15)
server | at FSWatcher.NodeFsHandler._watchWithNodeFs
(/home/ayush/Code/sails/server/node_modules/chokidar/lib/nodefs-
handler.js:228:14)
server | at FSWatcher.NodeFsHandler._handleDir
(/home/ayush/Code/sails/server/node_modules/chokidar/lib/nodefs-
handler.js:407:19)
server | at FSWatcher.<anonymous>
(/home/ayush/Code/sails/server/node_modules/chokidar/lib/nodefs-
handler.js:455:19)
server | at FSWatcher.<anonymous>
(/home/ayush/Code/sails/server/node_modules/chokidar/lib/nodefs-
handler.js:460:16)
server | at FSReqWrap.oncomplete (fs.js:123:15)
client | Proxying to http://127.0.0.1:1337
client | Livereload server on http ://localhost:49153
client | Serving on http ://localhost:4200/

Related

I got this error when run socket.io in docker

Error:
events.js:167
node_app_1 | throw er; // Unhandled 'error' event<br>
node_app_1 | ^
node_app_1 | Error: listen EADDRNOTAVAIL 50.177.55.2:3000<br>
node_app_1 | at Server.setupListenHandle [as _listen2] (net.js:1269:19)<br>
node_app_1 | at listenInCluster (net.js:1334:12)<br>
node_app_1 | at GetAddrInfoReqWrap.doListen [as callback] (net.js:1460:7)<br>
node_app_1 | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:62:10)<br>
node_app_1 | Emitted 'error' event at:<br>
node_app_1 | at emitErrorNT (net.js:1313:8)<br>
node_app_1 | at process._tickCallback (internal/process/next_tick.js:63:19)<br>
Update:
Change your socker-io server's IP to 127.0.0.1
Your app is trying to listen on port 3000 and I believe it is already being used.
If you have some other service running on this port, you will either have to change the port of your socket-io server or follow the following process to kill the process that is already listening on port 3000.
Type the following in your terminal,
lsof -i:3000
It will show you the process that is listening to that port. Then you can kill that process using its process ID (PID)
kill -9 <PID>

Connecting mLab to Node via Mongoose

I am trying to follow this tutorial: https://medium.com/#bryantheastronaut/react-getting-started-the-mern-stack-tutorial-feat-es6-de1a2886be50
I'm stuck because I can't find a way to connect my mLab database to node. I have figured out that the <> around the user name and password need to be removed from the string, but I still can't get it to connect.
mongoose.connect('mongodb://Testerxxx:Testxxx#ds157057.mlab.com:57057/testxxxx');
The log shows the error as:
(node:91198) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
09:37:34 api.1 | events.js:183
09:37:34 api.1 | throw er; // Unhandled 'error' event
09:37:34 api.1 | ^
09:37:34 api.1 | Error: listen EADDRINUSE :::3001
09:37:34 api.1 | at Object._errnoException (util.js:1022:11)
09:37:34 api.1 | at _exceptionWithHostPort (util.js:1044:20)
09:37:34 api.1 | at Server.setupListenHandle [as _listen2] (net.js:1351:14)
09:37:34 api.1 | at listenInCluster (net.js:1392:12)
09:37:34 api.1 | at Server.listen (net.js:1476:7)
When I follow the link to the readme for this error: http://mongoosejs.com/docs/connections.html#use-mongo-client, I can't actually see any instructions that differ from those in the tutorial.
Can anyone see what's wrong with this from. I've used the exact string from the Mongo DB connect page, inserting the mongoose.connect bit at the front.
Can anyone point to more detailed instructions for connecting to mLab?
Another hypothesis:
When I run npm run start-dev, the terminal shows a message that says:
Local: http://localhost:3000/
12:58:52 web.1 | On Your Network: http://10.0.0.2:3000/
12:58:52 web.1 |
However, the page I'm trying to check is port 3001 (per the tutorial). My server.js file also asks for the 3001 port to be used:
var port = process.env.API_PORT || 3001;
Maybe the reason why I can't get a response for the mLab connection is something to do with the difference in ports. If that's the case, I don't understand because, to this point, I have followed the tutorial in the setup.

Localhost POST request for GroupMe Bot

I'm trying to test a GroupMe bot that I made using Node.js. I'm using the Example Bot by GroupMe. After running foreman start and
curl -X POST -d \cool guy\ localhost:5000 (from a similar question), I get the error curl: (1) Protocol "guy http" not supported or disabled in libcurl. I tried wrapping the message in double quotes, but that only resulted in a syntax error. How can I fix this?
Edit:
I tried
$ curl -X POST -d "cool guy" localhost:5000
and got the following error from foreman:
22:04:16 web.1 | started with pid 5788
22:04:32 web.1 | undefined:1
22:04:32 web.1 | cool guy
22:04:32 web.1 | ^
22:04:32 web.1 | SyntaxError: Unexpected token c
22:04:32 web.1 | at Object.parse (native)
22:04:32 web.1 | at Object.respond (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\bot.js:11:24)
22:04:32 web.1 | at apply (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\node_modules\director\lib\director\router.js:448:19)
22:04:32 web.1 | at _every (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\node_modules\director\lib\director\router.js:30:9)
22:04:32 web.1 | at Router.invoke (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\node_modules\director\lib\director\router.js:454:5)
22:04:32 web.1 | at IncomingMessage.parseAndInvoke (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\node_modules\director\lib\director\http\index.js:175:10)
22:04:32 web.1 | at IncomingMessage.g (events.js:199:16)
22:04:32 web.1 | at IncomingMessage.emit (events.js:104:17)
22:04:32 web.1 | at _stream_readable.js:908:16
22:04:32 web.1 | at process._tickCallback (node.js:355:11)
22:04:32 web.1 | exited with code 1
22:04:32 system | sending SIGKILL to all processes
Add http:// in front of localhost. Libcurl, the library that curl uses, supports many different protocols. Curl is correctly assuming http, but seems to be have a bug.
Edit: after reading the question again, I see that curl was compiled without http support. If you compiled it yourself, make sure to enable http support. If you installed it using a distributions package manager, try reinstalling.

Port in use when launching Node.js app with Heroku Foreman

I am trying to deploy my node.js app to heroku but when I try to launch it locally using foreman I am getting Error: listen EADDRINUSE. I have run a netstat and grepped for the port nothing else is using it and the server starts without issue when running directly as a node http server.
The app I am trying to deploy is using mongo and redis I am not sure if these components will effect the server starting with Foreman. Does anyone have any suggestions on areas I could look at for potential bugs?
foreman start
01:37:18 web.1 | started with pid 1835
01:37:18 web.1 | /usr/local/foreman/lib/foreman/process.rb:66: warning: Insecure world writable dir /usr/local in PATH, mode 040777
01:37:19 web.1 | events.js:72
01:37:19 web.1 | throw er; // Unhandled 'error' event
01:37:19 web.1 | ^
01:37:19 web.1 | Error: listen EADDRINUSE
01:37:19 web.1 | at errnoException (net.js:863:11)
01:37:19 web.1 | at Server._listen2 (net.js:1008:14)
01:37:19 web.1 | at listen (net.js:1030:10)
01:37:19 web.1 | at Server.listen (net.js:1096:5)
01:37:19 web.1 | at Function.app.listen (/Users/craig/Documents/Sandboxes /xxx/node_modules/express/lib/application.js:535:24)
01:37:19 web.1 | at Object.<anonymous> (/Users/craig/Documents/Sandboxes/xxx/web.js:25:5)
01:37:19 web.1 | at Module._compile (module.js:456:26)
01:37:19 web.1 | at Object.Module._extensions..js (module.js:474:10)
01:37:19 web.1 | at Module.load (module.js:356:32)
01:37:19 web.1 | at Function.Module._load (module.js:312:12)
01:37:19 web.1 | exited with code 8
01:37:19 system | sending SIGTERM to all processes
SIGTERM received
Thanks.
--Additional information--
The procfile just has one entry:
web: node web.js
and I have set the listener up as follows:
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});
I just ran into this on OS X. It looks like foreman picks port 5000 by default, which seems to conflict with Bonjour/mDNS/UPNP services. (From what I've read. I haven't taken the time to pick out which it is.)
However, you can change the port that foreman uses in two ways: specify the port on the command line or create a .foreman file with the port number specified there.
Good luck and happy coding!
I had the same issue, Error: listen EADDRINUSE means that a Node server is already running.
Check that you are not running a Node server for the same project locally. If you are working on a GitHub synced project locally (on port 5000 for instance) which is tied to Heroku you cannot run a local Node server for that project as the port will be in use twice.
I was actually running a Node server on a project in a different Terminal window and didn't notice immediately.

multiple node.js + always = Error: watch EMFILE

I'm running three node.js applications on one server, all using Foreman to start up the apps through always.js.
Under zero load, one of my apps consistently throws the error Error: watch EMFILE and restarts. That application still works though, despite constantly throwing that error... I've tried to find more information about this error, but there's not a whole lot out there ("too many files open" or "increase ulimit".)
My question is: why would this be happening on an idle web application - and why just one out of three? It's not doing anything... Is it an issue with always.js? (There are two other node apps running through always on this machine though...) Just looking for some info as to what is causing this error, if it's serious, and how it can be resolved.
Thanks!
FYI, here is a relevant excerpt from the console:
01:17:07 web.1 | app listening on http://0.0.0.0:5000
01:17:07 web.1 | NODE_ENV = development
01:17:07 web.1 | opened connection to database!
01:17:07 web.1 | [always] Error: watch EMFILE
01:17:07 web.1 | [always] Error: watch EMFILE
01:17:07 web.1 | at errnoException (fs.js:636:11)
01:17:07 web.1 | at FSWatcher.start (fs.js:663:11)
01:17:07 web.1 | at Object.watch (fs.js:691:11)
01:17:07 web.1 | at Object.oncomplete (/home/jesse/local/nodev0.6.14/lib/node_modules/always/lib/monitor.js:62:36)
01:17:07 web.1 | [always] Restarting app.js with Node
I don't have experience with always.js but got similar errors with other node utilities that use the fs.watch command, which in turn uses linux's inotify API.
You might want to try checking the settings for inotify then:
cat /proc/sys/fs/inotify/max_user_instances
If the file exists, setting it to a higher value might help:
echo 8704 > /proc/sys/fs/inotify/max_user_instances

Resources