Question

I am trying to install node-opencv . The repo is successfully build . I want the opencv project to be installed as node_module globally .

Is that possible ?

I am new to node world.


'node-gyp rebuild' is same as 'npm install' ?

Because is built the repo of node-opencv but still my project looks for the dependency for HTTP

Answered : by Jonathan Lonowski in his comment.Please read the comments .Really helpful


I have opencv as dependency in my project .I have build the repo of opencv But still my project is making http call for opencv dependency.

I want the build repo to be used .

Was it helpful?

Solution

I want the opencv project to be installed as node_module globally. Is that possible?

"Global" packages, installed with -g or --global option, are not intended to be available for require():

  • Install it locally if you're going to require() it.
  • Install it globally if you're going to run it on the command line.

You can, however, install them locally to a parent directory. As long as the location can be found following the rules described for node_module folders, it can be required:

For example, if the file at '/home/ry/projects/foo.js' called require('bar.js'), then node would look in the following locations, in this order:

  • /home/ry/projects/node_modules/bar.js
  • /home/ry/node_modules/bar.js
  • /home/node_modules/bar.js
  • /node_modules/bar.js

I have build the repo of opencv But still my project is making http call for opencv dependency.

For this, it would help if you could elaborate on how you've installed the package, including how you're specifying it as a dependency.

But, further HTTP requests should only be needed for packages upon request:

# download and build the latest version
npm install opencv

# it should remain at that version until you request an update
npm update opencv
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top