Search code examples
node.jswebrtcmime

webrtc error with mime.lookup


I tried webrtc demo on my PC. but in demo step-04. When I use npm install and node index.js,it shows "TypeError: mime.lookup is not a function".

even after I installed mime by typing "npm install mime"

How can I fix this and make the demo work?


Solution

  • use mime-type instead of mime. So, Install mime-types first:
        npm install mime-types
    then make change in your code:
        var mime=require('mime-types');