2014-12-11 94 views
3

我正在尝试使用https://github.com/ddollar/heroku-buildpack-apt在heroku上安装phash。我想用我的node.js应用程序使用https://github.com/mgmtio/phash-imageheroku pkg-config安装失败

我现在有一个Aptfile

cimg-dev 
libphash0-dev 
libmagickcore-dev 

不过,我目前得到以下错误:

remote:  > [email protected] install /tmp/build_52b169122dc28a567a6f55c3b892c560/node_modules/phash-image 
remote:  > node-gyp rebuild 
remote:   
remote:  Package pHash was not found in the pkg-config search path. 
remote:  Perhaps you should add the directory containing `pHash.pc' 
remote:  to the PKG_CONFIG_PATH environment variable 
remote:  No package 'pHash' found 
remote:  gyp: Call to 'pkg-config --libs-only-L --libs-only-other pHash' returned exit status 1. while trying to load binding.gyp 
remote:  gyp ERR! configure error 
remote:  gyp ERR! stack Error: `gyp` failed with exit code: 1 
remote:  gyp ERR! stack  at ChildProcess.onCpExit (/tmp/build_52b169122dc28a567a6f55c3b892c560/vendor/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16) 
remote:  gyp ERR! stack  at ChildProcess.emit (events.js:98:17) 
remote:  gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:810:12) 
remote:  gyp ERR! System Linux 3.8.11-ec2 
remote:  gyp ERR! command "node" "/tmp/build_52b169122dc28a567a6f55c3b892c560/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
remote:  gyp ERR! cwd /tmp/build_52b169122dc28a567a6f55c3b892c560/node_modules/phash-image 
remote:  gyp ERR! node -v v0.10.33 
remote:  gyp ERR! node-gyp -v v1.0.1 
remote:  gyp ERR! not ok 

这是什么意思?我如何解决它?

+0

你有没有安装[pHash](http://www.phash.org/)?和'PKG_CONFIG_PATH'集合? – Epicblood 2014-12-21 01:47:04

回答

0

对不起你们!问题在于我的其中一个buildpack正在搞乱配置路径。它有意义已被修复!

4

错误提示在pkg-config搜索路径中找不到包pHash。您应该将包含`pHash.pc'的目录添加到PKG_CONFIG_PATH环境变量中。 pHash的路径未设置。

尝试:

$ PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig 
$ export PKG_CONFIG_PATH 

,然后重建。

如果不列入工作

$ locate pHash.pc 

这会给你pHash.pc的路径。使用路径(不pHash.pc),并把它添加到PKG_CONFIG_PATH

$ export PKG_CONFIG_PATH= <path_here> 

类似的问题在这里提出在node canvas githib