justadudewhohacks / justadudewhohacks/opencv4nodejs

SOLVED macOS Installation issues.

Open
#852 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

ERROR:

Error: Cannot find module '/Users/yourName/Desktop/project2/node_modules/opencv4nodejs/build/Release/opencv4nodejs'

Follow these steps and you should be able to install and work with this library. I've spent several hours trying to solve the issue and I think I've found something that works:

1. Install OpenCV:

- brew install opencv@4
- brew link --force opencv@4

2. Inside your repository:

- Install your node modules but avoid installing opencv4nodejs via npm i.
- Use a specific node version with nvm, node v14.18.1 or v14.17.0 will do.
- Run `export CXXFLAGS="-std=c++14 -Wno-c++11-narrowing"` in the root of your project.
- Run `npm install opencv4nodejs`

This process should actually trigger the build in opencv4nodejs and now the module can be used without issues.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.