Reputation: 81
I am trying to install spika backend (node applicaton) When I tried Start server in stand alone mode with the following command: $ node src/server/main.js
I encountered this error:
Error: Cannot find module 'socket.io-client/dist/socket.io.min.js'
Node version: v8.10.0 npm version: v3.5.2
Upvotes: 4
Views: 2298
Reputation: 8152
Install socket.io and not socket.io-client
socket.io-client is the client side library, not server side. You have to link it in your HTML instead of including it in your node.js file. It is socket.io library actually that is to be included server side. Read more on How To Do here.
Upvotes: 2
Reputation: 36630
Try running the following in the terminal at the directory of your package.json file
:
npm i
npm i --save socket.io
npm i
will install all the dependencies in your package.json
filenpm i --save socket.io
Upvotes: 1