Can't install opencv w/ npm - node.js

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

OP here. This ended up being multiple things.
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.
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.
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

Related

chartjs-node-canvas install (build) error

I want to render a chart to use with my discord bot and so far all the tutorials i have seen are using the chartjs-node-canvas module. But it gives errors when installing.
If someone gives me an alternative package to chartjs-node-canvas this is perfectly fine but i would prefer just solving this error and using the existing package.
Since stackoverflow does not allow adding text files (and if i just paste the text it is more than 30000 characters) here is a link to a pastebin with the npm log
pastebin.com/raw/yXrTyq85
I believe the problem lies in the installation of node-canvas which is a dependency for chartjs-node-canvas. After spending a lot of time researching why the library isn't getting installed, I got a lead to the following link: https://github.com/Automattic/node-canvas/wiki#installation-guides
I installed the below-mentioned dependencies on my machine and used a node version of 16.x
This did the work for me.
Here is how I installed the required dependencies:
brew install pkg-config cairo pango libpng jpeg giflib librsvg
After installing these dependencies, you can install the library using npm or yarn.

npm installing wrong version of anuglar(8.1.0)

when i run the following command, it shows 6.4.1.
npm run ng --version
but when i am running the following command, it is installing 8.1.0 and getting error. i do not understand how it is happening.
npm install -g #angular/cli
i tried the following commands. but it is not working
npm cache clean --force
npm install -g #angular/cli
Error Screen
My Requirement:
Angular 6
how can i resolve this?
You should the latest (12+) node when upgrading to angular 8. You can download it from here.
After upgrading node, the issues should go away.
For simple use cases and thanks to the work done in Angular 8, you can upgrade to the latest release using one command:
$ ng update #angular/cli #angular/core
After running this command, the lazy loaded routes will be automatically migrated to the new import syntax which is standard compliant and brings Angular close to the open web platform.
You also need to be aware of the following issues when upgrading your project:
Angular 8 makes use of the latest TypeScript 3.4, so even if the upgrade process completes with success you might have some syntax errors that may be due to the better type inference system used by the latest version which detects new potential typing issues but in the end this will improve your code quality and helps you avoid bugs in the future. You can see the new features of TypeScript 3.4 from the official docs.
You need to have Node.js 12+. Simply run node -v to verify your Node version. You can install the latest version from the official website

Upgrade from node6.x to node8.x gives "node-saas" binding errors

On windows 64 bit platform, upgrade from Node6.x to Node8.x gave the following
Error: Missing binding C:\bisbor1\src\main\webapp\node_modules\node-sass\vendor\win32-x64-57\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 8.x
It also asks to build the node-saas library for which it is mandatory to install Python. For a front end developer, it seems a bit bizarre to install Python to run a simple "Hello Angular" app. And funnily, i don't even need node-saas. Its not a direct dependency for my application.
After breaking my head over installing Python to reinstalling "node_modules" several times (never mind the "download" of the internet that 'npm install' demands), I finally found peace with the following solution.
"Downloaded the appropriate platform specific binding file (note the version of binding in the error thrown) from the git repository
https://github.com/sass/node-sass/releases
And updated the node-sass binding in my npm cache which is located at C:\Users\bisbor1\AppData\Roaming\npm\node_modules\ng-packagr\node_modules\node-sass\vendor\win32-x64-57"
The Primary step is to ensure that you are having Python 2.7 installed, because node-gyp only supports python2, as of writing the post.
To do so:
check whether Python Version is 2.7 or lower using python --version
downgrade using sudo apt-get install python
then rebuild node-sass using npm rebuild-node-sass
If everything else is correct, then a npm start would launch your App.

Why does Node.js's Mac Package ship with old version of npm? any issues?

I just installed the current version of node (3/14/16) 4.4.0 directly from Node.js via a Mac Package (the new suggested way, previously I installed via Homebrew).
I'm curious if anyone knows why the package ships with npm version 2.14.20, the book I'm going through suggests updating npm manually with the command
sudo npm install npm -g
The version I see is now 3.8.1, that's quite a large difference hence my question, is it safe/smart to be this far ahead of what Node.js is officially putting out with their Mac package file?
EDIT:
It appears it's common for Node's recommended v4.x install to come with npm 2.x, the question that remains is, will there be any negative side effects of using the newest npm but an older version of node?

Npm 2.x errors on Windows

I have installed NodeJs 4.2.1 and Npm 2.14.7 successfully on Windows 10 x64, but when at the time of gathering dependencies on my new and clean system I'm having several errors. This is what I have done so far:
I have cloned many examples from take: github https://github.com/developit/express-es6-rest-api to name one, when I run npm install on it everything works fine, but when I run npm start it raises errors for missing packages for instance: babel-core/register, utf8, requests, etc. It seems that npm is not installing the 2nd dependency level way down. How can I fix this?, as I said before I've tried with several tutorials and even with something mine and everything is the same. I need a hand, noob on NodeJS here.

Resources