I want to use socket.io and https://socket.io/get-started/chat/ user this link to understand when I try to run node index.js
I got an error
const WebSocket = require('./lib/WebSocket');
^^^^^ SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Server.init (C:\WEBLER\Socket.io\node_modules\socket.io\node_modules\engi ne.io\lib\server.js:119:16)
at new Server (C:\WEBLER\Socket.io\node_modules\socket.io\node_modules\engin e.io\lib\server.js:65:8)
at Function.attach (C:\WEBLER\Socket.io\node_modules\socket.io\node_modules\ engine.io\lib\engine.io.js:123:16)
I looked at problems . generally people say upgrade version of node.js
when I run node --version
answer is 2.7.4 I tried
npm cache clean -f
npm install stable
node --version
but it wasn't solved. How can I solve problem?