0

I need to install vega package of npmjs (See here). But $ sudo npm -g install vega throws the following errors. Any help will be highly appreciated. Thanks in advance for your help.

$ sudo apt-get install nodejs
$ sudo npm -g install npm

$ node --version
v0.10.33

$ nodejs --version
v0.10.33


$ sudo npm -g install vega

> [email protected] install /usr/lib/node_modules/vega/node_modules/canvas
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/yaseen/.node-gyp/0.10.33"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/vega/node_modules/canvas/.node-gyp"
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.13.0-40-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/vega/node_modules/canvas
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 

> [email protected] install /usr/lib/node_modules/vega/node_modules/d3/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/yaseen/.node-gyp/0.10.33"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/vega/node_modules/d3/node_modules/jsdom/node_modules/contextify/.node-gyp"
make: Entering directory `/usr/lib/node_modules/vega/node_modules/d3/node_modules/jsdom/node_modules/contextify/build'
  CXX(target) Release/obj.target/contextify/src/contextify.o
  SOLINK_MODULE(target) Release/obj.target/contextify.node
  SOLINK_MODULE(target) Release/obj.target/contextify.node: Finished
  COPY Release/contextify.node
make: Leaving directory `/usr/lib/node_modules/vega/node_modules/d3/node_modules/jsdom/node_modules/contextify/build'
npm ERR! Linux 3.13.0-40-generic
npm ERR! argv "node" "/usr/bin/npm" "-g" "install" "vega"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls canvas
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/yaseen/npm-debug.log
3
  • 1
    Following the instructions given here solved the problem.
    – MYaseen208
    Dec 4, 2014 at 5:58
  • Provide it as an answer please so you can reward the bounty ;)
    – Rinzwind
    Dec 7, 2014 at 9:26
  • @Rinzwind: I think I cannot reward bounty to myself. Is it not?
    – MYaseen208
    Dec 7, 2014 at 10:04

1 Answer 1

1

The following commands fixed the problem.

sudo apt-get install libcairo2-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libgif-dev

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .