When installing any packages, npm gives me an error:

npm ERR! Class constructor LRUCache cannot be invoked without 'new'
npm ERR! Can be found in:
npm ERR! /root/.npm/_logs/2019-01-11T08_36_24_229Z-debug.log

Tell me please, what could be the problem?

Closed due to the fact that it is off topic by participants aleksandr barakin , 0xdb , Dmitry Kozlov , freim , LFC Jan 23 at 15:03 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - aleksandr barakin, Dmitry Kozlov, freim, LFC
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • There is nothing to be done, the package is just broken. If you go to their github repository in the issues section, you will find many open installation problems there. - Beast Winterwolf

3 answers 3

 npm install peterbraden/node-opencv 

This is some kind of left command, on their website there is an instruction from 5 steps and the command looks like this:

 npm install opencv 
  • Gives the same thing. - Log1c0
  • @ Log1c0, completed all 5 steps? And other packages are put? - Qwertiy ♦
  • I have linux, other packages are not installed ( - Log1c0

In order to install npm packages you just need to write

 npm i имя ΠΏΠ°ΠΊΠ΅Ρ‚Π° 

or

 npm install имя ΠΏΠ°ΠΊΠ΅Ρ‚Π° 

In your case for opencv you should write

 npm i opencv 

Link to npm here

  • Unfortunately, it did not help - Log1c0

Solved the problem by updating nodejs to version 10. Thanks to all!