2
votes

NodeJs is latest version, npm is latest and they both work kinda.

My problem is, that when i try to run nodemon exampleFile.js, it returns nothing and nothing happends, same with forever, forever start exampleFile.js, i tried to install them both globally too, but result is the same.

I tried restarting server, still nothing!

1 more problem, when i run node exampleFile.js, that doesnt work, acts like the same, returns nothing but when i run nodejs exampleFile.js, it works perfectly!

exampleFile content:

var io = require('socket.io').listen(5555);
var login = io.of('/login').on('connection', function (socket) {});
var notify = io.of('/notifications').on('connection', function (socket) { });
var chat = io.of('/chat').on('connection', function (socket) { });

If anyone here can help me with my broken server and how to fix it, help me out!

OS Ubuntu 14.04

1
I'm trying to diagnose the source of the issue here: github.com/remy/nodemon/issues/422 can you post on the github issue because I can't replicate this issue at all (yet). - Remy Sharp

1 Answers

4
votes

I had similar symptoms to you, npm was working but things like forever weren't doing anything - no errors, nothing.

After I read here that you are supposed to use nodejs to install, i.e.

sudo apt-get install nodejs

I thought that maybe that had messed things up somehow, but after a few reinstalls... no dice :(

What did work

Apparently you need to link node with nodejs, like this:

sudo ln -s /usr/bin/nodejs /usr/local/bin/node