opencv4nodejs
opencv4nodejs copied to clipboard
Module parse failed: Unexpected character '�' (1:2)
When I install opencv4nodejs in vue application and run it I get the following error message
Failed to compile.
./node_modules/opencv4nodejs/build/Release/opencv4nodejs.node 1:2
Module parse failed: Unexpected character '�' (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
- yarn add node-loader
- add below settings to webpack settings
module: { rules: [ { test: /.node$/, use: 'node-loader' } ] }
I had the same problem in the latest Vuecli, using the answer from upstairs, I did not have 'test'.Use: rule(/.node$/) .use('node-loader') .loader('node-loader'), and NPM install node-loader, new issue Node-loader and vue-loader conflic