EyalAr / lwip

Light Weight Image Processor for NodeJS
MIT License
2.37k stars 231 forks source link

Failed to build in Heroku (node v6.10.2) #298

Open OussamaRomdhane opened 7 years ago

OussamaRomdhane commented 7 years ago
npm ERR! node v6.10.2
       npm ERR! npm  v3.10.10
       npm ERR! code ELIFECYCLE

       npm ERR! lwip@0.0.9 install: `node-gyp rebuild`
       npm ERR! Exit status 1
       npm ERR!
       npm ERR! Failed at the lwip@0.0.9 install script 'node-gyp rebuild'.
       npm ERR! Make sure you have the latest version of node.js and npm installed.
       npm ERR! If you do, this is most likely a problem with the lwip package,
       npm ERR! not with npm itself.
       npm ERR! Tell the author that this fails on your system:
       npm ERR!     node-gyp rebuild
       npm ERR! You can get information on how to open an issue for this project with:
       npm ERR!     npm bugs lwip
       npm ERR! Or if that isn't available, you can get their info via:
       npm ERR!     npm owner ls lwip
       npm ERR! There is likely additional logging output above.

       npm ERR! Please include the following file with any support request:
       npm ERR!     /tmp/build_99265a0bab5ed98b6bb931306e82910b/MangooID-Back-End-753f7829e6307dcbe4d84626349eeba8d3af1861/npm-debug.log
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/
alperozisik commented 7 years ago

I have problem with node 6.10.2 too. I have tested also with 4.7.3; does not build 4.4.7 works.

It is not related with Heroku. I was running the script in a container

OussamaRomdhane commented 7 years ago

@alperozisik In case this helps you I had to downgrade to node 6.9.2 and npm 3.10.9 (matched my production to my development environment which I should have done since the beginning)

In Heroku the node js version the server uses is the same found in the package.js file under the engines property so I just changed that from

"engines": {
    "node": "6.x"
  }

to

"engines": {
    "node": "6.9.2",
    "npm": "3.10.9"
  }

That fixed it for me because lwip always worked in my dev environment and used to work but stopped working in our prod environment.

Now, you may not be able to do that; I was able to because I'm the sole back end developer in the team and I knew any node 6 version will do. However if you can change the node and npm version as you like then I recommend to change to those settings.

katelovescode commented 7 years ago

Chiming in, also problems with 6.10.2 on my local.

SimonSchick commented 7 years ago

Same problem here, builds with 6.9

jpepper07 commented 7 years ago

Thanks for pointing me int he right direction @OussamaRomdhane . It seems heroku updated their engines.

zxfrank commented 7 years ago

Same problem here (not with heroku)

_CC(target) Release/obj.target/lwip_decoder/src/lib/png/png.o In file included from ../src/lib/png/png.c:14:0: ../src/lib/png/pngpriv.h:805:4: error: #error ZLIB_VERNUM != PNG_ZLIB_VERNUM "-I (include path) error: see the notes in pngpriv.h" error ZLIB_VERNUM != PNG_ZLIB_VERNUM ^ lwip_decoder.target.mk:165: recipe for target 'Release/obj.target/lwip_decoder/src/lib/png/png.o' failed make: *** [Release/obj.target/lwip_decoder/src/lib/png/png.o] Error 1 make: Leaving directory '[MY FOLDER]/node_modules/lwip/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:285:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Linux 4.4.0-72-generic gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd [MY FOLDER]/nodemodules/lwip gyp ERR! node -v v6.10.2 gyp ERR! node-gyp -v v3.6.0 gyp ERR! not ok

ubuntu 16.04.2 GNU Make 4.1 gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

zxfrank commented 7 years ago

see #297

arackaf commented 7 years ago

For the benefit of anyone else in search of a solution, your best bet may be to give jimp a try. It has a similar (and sometimes simpler) API, with zero external dependencies, so no more struggling with node-gyp.

https://www.npmjs.com/package/jimp