简体   繁体   English

heroku pkg-config安装失败

[英]heroku pkg-config install failure

i'm trying to install phash on heroku using https://github.com/ddollar/heroku-buildpack-apt . 我正在尝试使用https://github.com/ddollar/heroku-buildpack-apt在heroku上安装phash。 i'd like to use it in my node.js app using https://github.com/mgmtio/phash-image . 我想使用https://github.com/mgmtio/phash-image在我的node.js应用程序中使用它。

I currently have an Aptfile : 我目前有一个Aptfile

cimg-dev
libphash0-dev
libmagickcore-dev

However, I'm currently getting the following error: 但是,我目前收到以下错误:

remote:        > phash-image@3.0.0 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 

what does this mean? 这是什么意思? how do i fix it? 我如何解决它?

The error says package pHash was not found in the pkg-config search path. 该错误表示在pkg-config搜索路径中找不到包pHash。 You should add the directory containing `pHash.pc' to the PKG_CONFIG_PATH environment variable. 您应该将包含“pHash.pc”的目录添加到PKG_CONFIG_PATH环境变量中。 The path to pHash is unset. pHash的路径未设置。

Try: 尝试:

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

and then rebuild. 然后重建。

If that doesnot work 如果这不起作用

$ locate pHash.pc

this will give you a path to pHash.pc. 这将为您提供pHash.pc的路径。 Use the path (minus pHash.pc) and add it to PKG_CONFIG_PATH 使用路径(减去pHash.pc)并将其添加到PKG_CONFIG_PATH

$ export PKG_CONFIG_PATH= <path_here>

The similar issue was raised here in node canvas githib 类似的问题在node canvas githib中引发了

sorry guys! 对不起大家! the problem was that one of my other buildpacks was messing up the config path. 问题是我的其他构建包之一搞乱了配置路径。 it has sense been fixed! 它有意义固定!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM