How to downgrade to a previous Node version

Warning: This answer does not support Windows OS You can use n for node’s version management. There is a simple intro for n. $ npm install -g n $ n 6.10.3 this is very easy to use. then you can show your node version: $ node -v v6.10.3 For windows nvm is a well-received tool.

socket.io private message

No tutorial needed. The Socket.IO FAQ is pretty straightforward on this one: socket.emit(‘news’, { hello: ‘world’ }); EDIT: Folks are linking to this question when asking about how to get that socket object later. There is no need to. When a new client connects, save a reference to that socket on whatever object you’re keeping … Read more

How to chain a variable number of promises in Q, in order?

There’s a nice clean way to to this with [].reduce. var chain = itemsToProcess.reduce(function (previous, item) { return previous.then(function (previousValue) { // do what you want with previous value // return your async operation return Q.delay(100); }) }, Q.resolve(/* set the first “previousValue” here */)); chain.then(function (lastResult) { // … }); reduce iterates through the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)