【问题标题】:heroku pkg-config install failureheroku pkg-config 安装失败
【发布时间】:2014-12-11 01:55:36
【问题描述】:

我正在尝试使用 https://github.com/ddollar/heroku-buildpack-apt 在 heroku 上安装 phash。我想使用 https://github.com/mgmtio/phash-image 在我的 node.js 应用程序中使用它。

我目前有一个Aptfile

cimg-dev
libphash0-dev
libmagickcore-dev

但是,我目前收到以下错误:

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 

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

【问题讨论】:

  • 您是否安装了pHash?和PKG_CONFIG_PATH 设置?

标签: node.js heroku apt


【解决方案1】:

错误提示在 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 中提出了类似的问题

【讨论】:

    【解决方案2】:

    对不起各位!问题是我的其他构建包之一弄乱了配置路径。感觉已经修复了!

    【讨论】:

      猜你喜欢
      • 2012-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多