首页 > 解决方案 > 使用 React 编译 opencv.js 失败

问题描述

制作了一个反应网络应用程序create-react-app并添加了opencv.js文件以在我的应用程序中使用它。

当我使用“npm start”启动应用程序时,它会说:

Failed to compile

./src/lib/opencv.js
  Line 2:39:        'define' is not defined                                                no-undef
  Line 4:5:         'define' is not defined                                                no-undef
  Line 30:2024:     'read' is not defined                                                  no-undef
  Line 30:2180:     'readbuffer' is not defined                                            no-undef
  Line 30:2200:     'read' is not defined                                                  no-undef

而这样的例子不胜枚举。我究竟做错了什么?

标签: javascriptreactjsopencvnpm

解决方案


推荐阅读