EyalAr / lwip

Light Weight Image Processor for NodeJS
MIT License
2.36k stars 230 forks source link

Compilation issue on AWS #193

Closed ChrisEdson closed 8 years ago

ChrisEdson commented 8 years ago

LWIP's installation seems to fail 50% of the time on AWS, when compiling.

The log is:

  > lwip@0.0.7 install /tmp/deployment/application/node_modules/lwip
  > node-gyp rebuild

  make: Entering directory `/tmp/deployment/application/node_modules/lwip/build'
    CXX(target) Release/obj.target/lwip_decoder/src/decoder/init.o
  virtual memory exhausted: Cannot allocate memory
  make: *** [Release/obj.target/lwip_decoder/src/decoder/init.o] Error 1
  make: Leaving directory `/tmp/deployment/application/node_modules/lwip/build'
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/opt/elasticbeanstalk/node-install/node-v0.12.6-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
  gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
  gyp ERR! System Linux 3.14.48-33.39.amzn1.x86_64
  gyp ERR! command "node" "/opt/elasticbeanstalk/node-install/node-v0.12.6-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
  gyp ERR! cwd /tmp/deployment/application/node_modules/lwip
  gyp ERR! node -v v0.12.6
  gyp ERR! node-gyp -v v2.0.1
  gyp ERR! not ok 
  npm ERR! Linux 3.14.48-33.39.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v0.12.6-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v0.12.6-linux-x64/bin/npm" "--production" "install"
  npm ERR! node v0.12.6
  npm ERR! npm  v2.11.2
  npm ERR! code ELIFECYCLE

  npm ERR! lwip@0.0.7 install: `node-gyp rebuild`
  npm ERR! Exit status 1

So I presume this is to do with the virtual memory being associated to the process. Has anyone come across this before?

EyalAr commented 8 years ago

You probably don't have enough RAM on your instance to compile the library. Try creating a swap file. See here.

BTW, LWIP 0.0.8 is available.

ChrisEdson commented 8 years ago

Thanks - I'll give this a go