Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependency 'stream' #237

Open
aescarcha opened this issue Jun 13, 2018 · 8 comments · May be fixed by #245
Open

Missing dependency 'stream' #237

aescarcha opened this issue Jun 13, 2018 · 8 comments · May be fixed by #245

Comments

@aescarcha
Copy link

When installing through NPM and running with webpack I get the following warning:

WARNING in ./node_modules/imsc/node_modules/sax/lib/sax.js
Module not found: Error: Can't resolve 'stream' in 'node_modules/imsc/node_modules/sax/lib'

I think the issue happens when Sax requires stream in this line

Doing an npm install stream solved the error for me, so adding it to the package.json dependencies should solve it too.

To reproduce this install a new Angular enviroment and npm i angular-dashjs-player

@lolo32
Copy link

lolo32 commented Jun 26, 2018

stream is a default nodejs module, like you could see at https://nodejs.org/docs/latest/api/stream.html
I think it's your nodejs interpreter that miss it.

@aescarcha
Copy link
Author

aescarcha commented Jul 4, 2018

It looks like the issue is Angular6-specific, as you can see here . The best solution is using readable-stream instead of stream.

From readable-stream README:

If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use readable-stream only and avoid the "stream" module in Node-core, for background see this blogpost.

@ALGDB
Copy link

ALGDB commented Dec 5, 2018

I had the same issue so far I solved it changing the "require('stream')" with require('readable-stream')

readable-stream

@hriverahdez
Copy link

Is there a way to remove the warning permanently without having to modify sax.js source?? I'm having the same issue on an angular app, although it's just a warning and it's working fine, but the warning is a bit annoying

@Yelinz
Copy link

Yelinz commented Feb 17, 2020

Also had this problem and changed to require('readable-stream') in the source and it still worked without errors.

@skorunka
Copy link

skorunka commented May 5, 2020

Same issue with Angular app

@skorunka
Copy link

skorunka commented May 6, 2020

@ALEXOTANO
Copy link

If you're on Angular App, this is how I solve it:

  1. install
npm install stream-browserify
  1. add the path to your `tsconfig.json
"compilerOptions": {
   ...
   "paths": {
        ...
        "stream": ["node_modules/stream-browserify"],
    } 
} 

I found out some people had the same issue with timers, so do the same with timers and timers-browserify.

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants