< Back to Support

Kollaborate Server: Socket server fails to run on NodeJS 7 and above


When running the socket server you may get an error similar to the following:

Starting secure server...
Socket.prototype.__proto__ = EventEmitter.prototype;
TypeError: Cannot read property 'prototype' of undefined
at Object. (/Applications/MAMP/kollaborate/websocket/node_modules/websocket.io/lib/socket.js:49:43)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/Applications/MAMP/kollaborate/websocket/node_modules/websocket.io/lib/protocols/drafts.js:12:14)
at Module._compile (internal/modules/cjs/loader.js:689:30)

This is because the socket server depends on a third-party component that is not currently compatible with Node.js 7 and higher. We plan to address this in a future update.


1. First uninstall the old version of Node.js.

On Ubuntu you can do this with the commands:

sudo apt-get remove nodejs
sudo apt-get remove npm

On macOS, if you installed with Homebrew, you can remove it with the command:

brew uninstall node

Other options for removing Node.js from macOS are available here.


2. Now install the 6.x version.

On Ubuntu type the commands:

curl -sL https://deb.nodesource.com/setup_6.x | bash -

sudo apt-get install -y nodejs

On macOS, type the commands:

brew install node@6
brew link node@6