xml2js in Angular 6: Can't resolve 'stream' and 'timers'
You’ll have to install those dependencies. It’s unfortunately not well documented.
npm install --save stream timers
For Angular to recognise xml2js, the following steps are required:
- Add the timers-browserify node module using "npm install timers-browserify"
- Add the stream-browserify node module using "npm install stream-browserify"
- Add the following path mapping in your tsconfig.json:
"compilerOptions": {
"paths": {
"timers": [
"node_modules/timers-browserify"
],
"stream": [
"node_modules/stream-browserify"
],
}
}