benjaminws / stomp-js

Implementation of the STOMP protocol in node.js
BSD 3-Clause "New" or "Revised" License
87 stars 47 forks source link

Missing npm dependencies #41

Open gottfrois opened 9 years ago

gottfrois commented 9 years ago

When install the package using npm and loading it with webpack here is what I have:

Module not found: Error: Cannot resolve module 'net' in /Users/gottfrois/Code/TextMaster.com/node_modules/stomp/lib
 @ ./~/stomp/lib/stomp.js 24:10-24

Module not found: Error: Cannot resolve module 'tls' in /Users/gottfrois/Code/TextMaster.com/node_modules/stomp/lib
 @ ./~/stomp/lib/stomp.js 25:10-24
Volodymyr128 commented 9 years ago

The same issue! Got:

ERROR in ./~/stompjs/lib/stomp-node.js
Module not found: Error: Cannot resolve module 'net' in D:\Projects\MyProject\node_modules\stompjs\lib

when running karma tests. Without Karma all works correct. Looks like stomp-js team ignoring the problem

Volodymyr128 commented 9 years ago

@gottfrois I solved this by adding

        node: {
            net: 'empty'
        }

to my webpackConfig.js

vianvio commented 8 years ago

Not sure if it's too late for this... I added a main property to the package.json of stompjs in node_module.

"main": "./lib/stomp.min.js"

this solve the issue of my situation. Hope it will help

elixiao commented 7 years ago

I edit file your_path/node_modules/stompjs/index.js, comment it like this:

var Stomp = require('./lib/stomp.js');
// var StompNode = require('./lib/stomp-node.js');

module.exports = Stomp.Stomp;
// module.exports.overTCP = StompNode.overTCP;
// module.exports.overWS = StompNode.overWS;
sinedsem commented 7 years ago

This repository is no longer supported by authors, isn't it? This is the only reason this issue still not fixed. Does anyone know a good fork? Or another module for stomp js?

BrandonDudek commented 6 years ago

I added an npm dependency of "net": "1.0.2" to solve the " Cannot resolve module 'net' " error.

(Using Angular 6 and Typescript)