stomp-js icon indicating copy to clipboard operation
stomp-js copied to clipboard

Missing npm dependencies

Open gottfrois opened this issue 9 years ago • 6 comments

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

gottfrois avatar May 27 '15 13:05 gottfrois

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 avatar Sep 16 '15 13:09 Volodymyr128

@gottfrois I solved this by adding

        node: {
            net: 'empty'
        }

to my webpackConfig.js

Volodymyr128 avatar Sep 16 '15 13:09 Volodymyr128

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

vianvio avatar May 29 '16 13:05 vianvio

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;

elixiao avatar Jan 19 '17 08:01 elixiao

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?

sinedsem avatar Feb 08 '17 09:02 sinedsem

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

(Using Angular 6 and Typescript)

BrandonDudek avatar Aug 23 '18 17:08 BrandonDudek