Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Magick++;在heroku上的node.js应用程序中_Heroku_Imagemagick_Npm_Node Gyp_Magick++ - Fatal编程技术网

使用Magick++;在heroku上的node.js应用程序中

使用Magick++;在heroku上的node.js应用程序中,heroku,imagemagick,npm,node-gyp,magick++,Heroku,Imagemagick,Npm,Node Gyp,Magick++,我试图将一个节点应用程序推送到heroku,但我正在使用,而且heroku似乎对Magick++有问题-我尝试过使用自定义构建包,但似乎找不到支持Magick++的。(1) 这就是问题所在(2)在Heorku上运行Magick++有什么解决方案吗 -----> Node.js app detected -----> Resolving engine versions Using Node.js version: 0.10.20 Using npm vers

我试图将一个节点应用程序推送到heroku,但我正在使用,而且heroku似乎对Magick++有问题-我尝试过使用自定义构建包,但似乎找不到支持Magick++的。(1) 这就是问题所在(2)在Heorku上运行Magick++有什么解决方案吗

-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.10.20
       Using npm version: 1.3.11
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       npm WARN package.json upload@0.1.3 'repositories' (plural) Not supported.
       npm WARN package.json Please pick one as the 'repository' field

       > bson@0.2.2 install /tmp/build_d2a98573-34b8-42d9-91ff-81c4ca84feb9/node_modules/mongoose/node_modules/mongodb/node_modules/bson
       > (node-gyp rebuild 2> builderror.log) || (exit 0)

       make: Entering directory `/tmp/build_d2a98573-34b8-42d9-91ff-81c4ca84feb9/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
         CXX(target) Release/obj.target/bson/ext/bson.o
         SOLINK_MODULE(target) Release/obj.target/bson.node
         SOLINK_MODULE(target) Release/obj.target/bson.node: Finished
         COPY Release/bson.node
       make: Leaving directory `/tmp/build_d2a98573-34b8-42d9-91ff-81c4ca84feb9/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'

       > kerberos@0.0.3 install /tmp/build_d2a98573-34b8-42d9-91ff-81c4ca84feb9/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
       > (node-gyp rebuild 2> builderror.log) || (exit 0)

       make: Entering directory `/tmp/build_d2a98573-34b8-42d9-91ff-81c4ca84feb9/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
         SOLINK_MODULE(target) Release/obj.target/kerberos.node
         SOLINK_MODULE(target) Release/obj.target/kerberos.node: Finished
         COPY Release/kerberos.node
       make: Leaving directory `/tmp/build_d2a98573-34b8-42d9-91ff-81c4ca84feb9/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'

       > imagemagick-native@0.2.8 install /tmp/build_d2a98573-34b8-42d9-91ff-81c4ca84feb9/node_modules/imagemagick-native
       > node-gyp rebuild

       /bin/sh: Magick++-config: not found
       gyp: Call to 'Magick++-config --ldflags --libs' returned exit status 127. 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 (/tmp/node-npm-k25M/node_modules/node-gyp/lib/configure.js:424:16)
       gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
       gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
       gyp ERR! System Linux 3.8.11-ec2
       gyp ERR! command "node" "/tmp/node-npm-k25M/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
       gyp ERR! cwd /tmp/build_d2a98573-34b8-42d9-91ff-81c4ca84feb9/node_modules/imagemagick-native
       gyp ERR! node -v v0.10.20
       gyp ERR! node-gyp -v v0.10.10
       gyp ERR! not ok
       npm ERR! weird error 1
       npm ERR! not ok code 0
 !     Failed to rebuild dependencies with npm

 !     Push rejected, failed to compile Node.js app

我在这方面取得了一些进展:

使用:

这样它就可以在nodejs之外加载。在
.buildpacks
中列出您的别克:

https://github.com/ddollar/heroku-buildpack-apt.git
https://github.com/heroku/heroku-buildpack-nodejs.git
现在通过apt将
libmagick++-dev
安装到名为
Aptfile
的文件中

现在,如果将imagemagick native包含在
包.json中:

"dependencies": {
    "imagemagick-native": "1.7.0"
}
它将开始编译。尽管APT包正确地设置了
$CPATH
节点gyp
似乎没有将其转发给gcc

这会导致以下错误:

remote:        > imagemagick-native@1.7.0 install /tmp/build_720834c3a32b65d69ae603d7c618e20f/node_modules/imagemagick-native
remote:        > node-gyp rebuild
remote:        
remote:        make: Entering directory `/tmp/build_720834c3a32b65d69ae603d7c618e20f/node_modules/imagemagick-native/build'
remote:          CXX(target) Release/obj.target/imagemagick/src/imagemagick.o
remote:        In file included from ../src/imagemagick.cc:9:
remote:        ../src/imagemagick.h:1:22: warning: Magick++.h: No such file or directory
所以它还没有解决问题,但我认为它走上了正确的轨道。仍在试图找出节点gyp的问题


更新 要解决该问题,请使用nodejs buildpack并将以下行添加到
bin/compile
的顶部:

path=`echo "$INCLUDE_PATH" | cut -d : -f 1`
export CXX="`which g++` -I$path/ImageMagick"
在cedar-14上工作。对于不推荐使用的
cedar
,您需要使用imagemagick native v1.22

path=`echo "$INCLUDE_PATH" | cut -d : -f 1`
export CXX="`which g++` -I$path/ImageMagick"