Search code examples
node.jsnpmopenshiftopenshift-3sharp

Build always failed while trying to install sharp or node-gyp on openshift v3


Build always failed with this log:

---> Installing application source ...
---> Building your Node application from source

> [email protected] install /opt/app-root/src/node_modules/sharp
> node-gyp rebuild

make: Entering directory `/opt/app-root/src/node_modules/sharp/build'
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
CXX(target) Release/obj.target/sharp/src/metadata.o
CXX(target) Release/obj.target/sharp/src/operations.o
CXX(target) Release/obj.target/sharp/src/pipeline.o

Trying to build from repo (bitbucket) on openshift v3 with nodejs v6. Works fine on localhost with nodejs v6.9.2, npm v4.2.0, sharp v0.18.4


Solution

  • If it is cutting off at that point with no obvious error message, you are likely running out of memory for the build. This is not uncommon for npm.

    See:

    which describes how to increase memory allocated to the build. That is for similar issue when using Python.