CamanJS icon indicating copy to clipboard operation
CamanJS copied to clipboard

Cannot install CamanJS with npm

Open nop33 opened this issue 7 years ago • 8 comments

› npm install caman

> [email protected] install /Users/myusername/dev/project-title/dev/node_modules/canvas
> node-gyp rebuild

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_lib.sh freetype' returned exit status 0 while in binding.gyp. 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/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/8.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/myusername/dev/project-title/dev/node_modules/canvas
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/myusername/.npm/_logs/2017-10-19T13_19_12_145Z-debug.log

In /Users/myusername/.npm/_logs/2017-10-19T13_19_12_145Z-debug.log:

...
400 verbose stack Error: [email protected] install: `node-gyp rebuild`
400 verbose stack Exit status 1
400 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
400 verbose stack     at emitTwo (events.js:125:13)
400 verbose stack     at EventEmitter.emit (events.js:213:7)
400 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
400 verbose stack     at emitTwo (events.js:125:13)
400 verbose stack     at ChildProcess.emit (events.js:213:7)
400 verbose stack     at maybeClose (internal/child_process.js:927:16)
400 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
401 verbose pkgid [email protected]
402 verbose cwd /Users/myusername/dev/project-title/dev
403 verbose Darwin 16.7.0
404 verbose argv "/usr/local/Cellar/node/8.6.0/bin/node" "/usr/local/bin/npm" "install" "caman"
405 verbose node v8.6.0
406 verbose npm  v5.5.1
407 error code ELIFECYCLE
408 error errno 1
409 error [email protected] install: `node-gyp rebuild`
409 error Exit status 1
410 error Failed at the [email protected] install script.
410 error This is probably not a problem with npm. There is likely additional logging output above.
411 verbose exit [ 1, true ]

Version of npm:

› npm -v
5.5.1

nop33 avatar Oct 19 '17 13:10 nop33

Same with npm 4.0.5

guilhermedelucas avatar Nov 25 '17 11:11 guilhermedelucas

Environmental variable problem

zhengyongxiong avatar Jan 12 '18 02:01 zhengyongxiong

you should add the path

zhengyongxiong avatar Jan 12 '18 02:01 zhengyongxiong

zhengyongxiong - can tell us in more detail!!

AndreyPatseiko avatar Mar 05 '18 13:03 AndreyPatseiko

On server side it depends on libcairo2 library, see the answer here: https://stackoverflow.com/a/27705973/266561

javascriptlove avatar Mar 14 '18 09:03 javascriptlove

You need to complete the node-canvas dependencies first then you will be able to install caman. I was able to successfully npm install caman through this approach.

kakaggarwal avatar Jul 04 '18 06:07 kakaggarwal

  • I met same problem and solved it by Installing node-gyp & Installing GTK 2
  • you need this.node-canvas[wiki].

WanderHuang avatar Jul 24 '18 15:07 WanderHuang

I'm facing the above issue, I tried everything suggested in comments and nothing seems to work. Can anyone guide me here!!

furyOO7 avatar Jul 02 '19 13:07 furyOO7