Node: Socket io require.resolve is not a function?
I'm surprised that googling it doesn't give me any results. Anyway, here's my problem when using socket.io
:
When I check further, it was from socket.io's original index.js file (line 28) causing the problem:
var clientSource = read(require.resolve('socket.io-client/socket.io.js'), 'utf-8');
So require.resolve () is not a function, I suspect it was my version of node at first, but no, I have updated to the latest version and it still persists.
I am using browserify and gulp to create an application file.
Who has a fix? Thanks to
+3
source to share