本文介绍了带有mime.lookup的webrtc错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PC上尝试了webrtc演示.但在演示步骤04中.当我使用npm install和节点index.js时,它显示"TypeError: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".

即使我通过输入"npm install mime"来安装mime

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

如何解决此问题并使演示工作正常?

How can I fix this and make the demo work?

推荐答案

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');

这篇关于带有mime.lookup的webrtc错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 02:42
查看更多