javascript - Can't get socket.io-client to run through browserify -


when include socket.io using require('socket.io-client') says can't find it, if try socket.io on following line:

var clientsource = read(require.resolve('socket.io-client/socket.io.js'), 'utf-8'); 

on 'resolve(' error: 'undefined not function'

my package.json:

{   "version": "0.0.1",   "main": "server.js",   "dependencies": {     "express": "4.9.x",     "react": "0.13.x",     "react-async": "2.1.x",     "react-timeago": "2.0.x",     "react-router-component": "0.24.x",     "superagent": "latest",     "react-document-title": "1.0.x",     "fibers": "^1.0.2",     "underscore": "1.8.x",     "http-proxy": "1.0.x",     "feathers": "1.0.x",     "socket.io": "1.3.x",     "material-ui": "0.7.x"   },   "devdependencies": {     "browserify": "9.0.x",     "grunt": "0.4.x",     "grunt-browserify": "^3.5.0",     "grunt-concurrent": "^1.0.0",     "grunt-contrib-watch": "^0.6.1",     "grunt-nodemon": "^0.4.0",     "grunt-react": "^0.10.0"   },   "license": "gpl" } 

you need install socket.io-client package separately socket.io package.

npm install --save socket.io-client 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -