Skip to content

Cannot find module 'ws' #21

@jsyrjala

Description

@jsyrjala

I am getting this error: Cannot find module 'ws' from '/home/some/path/myproject/node_modules/angular-websocket'

I think this is because I use http://browserify.org/ and angular-websocket has this code.

   // CommonJS
  if (typeof exports === 'object' && require) {
    try {
      ws = require('ws');
      Socket = (ws.Client || ws.client || ws);
    } catch(e) {}
  }

  // Browser
  Socket = Socket || $window.WebSocket || $window.MozWebSocket;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions