0
[ERROR in ./node_modules/stompjs/lib/stomp-node.js Module not found: Error: Can't resolve 'net' in 'C:\ANGULAR\websocket-example\node_modules\stompjs\lib'][1]

added stompjs to angular by npm install stompjs --save

imported into component.ts import * as Stomp from 'stompjs';

and got error when using like this let socket = new WebSocket("ws://localhost:8080/greeting"); let ws = Stomp.over(socket);

Claies
  • 22,124
  • 4
  • 53
  • 77
Arun Girivasan
  • 532
  • 1
  • 10
  • 24

1 Answers1

0

To add an external library to your angular project, you can add those to the angular.json

"scripts":[
   "node_modules/stompjs/lib/stomp-node.js"
]
Niral Munjariya
  • 1,371
  • 13
  • 27