Search code examples
node.jsopencvubuntunpmcloud9-ide

Can't install opencv w/ npm


I'm trying to install the opencv package for a project I'm working on by running the following:

npm install opencv --save

However, every attempt at doing so results in this long list of errors

I've been at a loss with this for a while now, but I'm afraid it may be because I'm not very well versed in working with ubuntu/npm, so the answer may be obvious

Things to take into consideration:

  • I'm working in a public cloud9 workspace
  • Ubuntu 14.04.2
  • Node 4.1.1
  • npm 2.14.4

Solution

  • OP here. This ended up being multiple things.

    1. the install instructions for OpenCV (help.ubuntu.com/community/OpenCV) reference outdated packages and therefore do not install properly, and if you're not watching it, you'll miss the fail messages, as the script attempts to continue despite the failed installs.
    2. after you get the script to run & install successfully, you'll notice that it installs the latest version of OpenCV, 3.1.0 which is perfectly acceptable.
    3. According to the .readme on the node-opencv github, You'll need OpenCV 2.3.1 or newer installed before installing node-opencv. you'll end up noticing this statement is partially untrue. In reality, you need any version between 2.3.1 and 2.4.11. Any version after 2.4.11 will result in a failed npm install