错误的ERR!在canvas@1.4.0安装脚本&node-gyp rebuild中失败

时间:2016-06-28 12:53:22

标签: node.js digital-ocean dokku node-canvas

我正在尝试使用digitalocean将我的应用部署到dokku。即使我已经使用ssh&to to to digitalocean machine并运行命令来安装所有依赖项,如wiki(sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++)中所述,我仍然收到以下错误:

   -----> Building dependencies
          Pruning any extraneous modules
          Installing node modules (package.json)

          > canvas@1.4.0 install /tmp/build/node_modules/canvas
          > node-gyp rebuild

          make: Entering directory `/tmp/build/node_modules/canvas/build'
          SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
          COPY Release/canvas-postbuild.node
          CXX(target) Release/obj.target/canvas/src/Canvas.o
          CXX(target) Release/obj.target/canvas/src/CanvasGradient.o
          CXX(target) Release/obj.target/canvas/src/CanvasPattern.o
          In file included from ../src/CanvasPattern.cc:9:0:
          ../src/Image.h:19:21: fatal error: gif_lib.h: No such file or directory
          #include <gif_lib.h>
          ^
          compilation terminated.
          make: *** [Release/obj.target/canvas/src/CanvasPattern.o] Error 1
          make: Leaving directory `/tmp/build/node_modules/canvas/build'
          gyp ERR! build error
          gyp ERR! stack Error: `make` failed with exit code: 2
          gyp ERR! stack     at ChildProcess.onExit (/tmp/build/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
          gyp ERR! stack     at emitTwo (events.js:87:13)
          gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
          gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
          gyp ERR! System Linux 3.13.0-85-generic
          gyp ERR! command "/tmp/build/.heroku/node/bin/node" "/tmp/build/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
          gyp ERR! cwd /tmp/build/node_modules/canvas
          gyp ERR! node -v v4.4.5
          gyp ERR! node-gyp -v v3.3.1
          gyp ERR! not ok

我搜索了很多,唯一的解决方案是安装libgif-dev,但我已经安装了它。那么任何想法可能都是错的?

规格:Ubuntu 14.04,dokku 0.6.3,节点4.4.5,npm 2.15.5

1 个答案:

答案 0 :(得分:1)

dokku的dokku-apt插件允许您在dokku容器中安装软件包(例如libgif-dev)。这个插件应该有所帮助,因为你实际上是在容器中构建canvas节点addon