2
I was here "playing" with Socket.io, all working nicely, when I gave the command node app.js
overnight Nodejs gives me an error (it was working before)
Cannot find module 'socket.io'
I looked for another example on the internet I pasted and he always tells me the same thing. But when I enter the Ode by cmd and I run var foo = require('socket.io');
it finds the module without any problem.
Have you installed the module? You did
npm install socket.io --save
?– Sergio
Yes, I installed it. I am now trying to install the module right from the application
– Mike
No @Sergio, but I just installed the module at the right of the app
– Mike
And now he’s found?
– Sergio
It worked, but I’m kind of "smart" maybe it’ll stop working again
– Mike
If you used
--save
it gets recorded in thepackage.json
and it will be installed when you donpm install
application next time. It seems that Walker responded with the answer, if the problem was that you can accept his answer.– Sergio
Yes, I was just waiting here for a while, but apparently it’s all in order. Right answer to him. But I will open another question because I came across another error in my app.
– Mike
It’s a good idea to wait longer before accepting it. In this case it was simple, in more complex cases more elaborate answers may come later.
– Sergio