I\'ve been following this(http://socket.io/get-started/chat/) tutorial on how to make a simple chat application using socket.io.
I tried to however use Express to create
Similar to answer above to not use npm start
.
I was using nodemon and with expressjs and expressjs generator. I was using nodemon to execute npm start
, while npm start itself execute node ./NodeApp/bin/www
So i edited to make nodemon to execute node ./NodeApp/bin/www
by itself and that error go away.
Conclusion
Before
package.json
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node ./NodeApp/bin/www",
"build": "webpack --watch",
"dev": "nodemon --exec npm start"
},
After
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --watch",
"dev": "nodemon --exec node ./NodeApp/bin/www"
},
So now I run my sever with npm run dev
and no more errors.