We have a nodejs application where I work which all of a sudden had problems getting provisioned using Amazon's ElasticBeanstalk. Certainly something must have changed and after digging a bit we linked the problem to a node-gyp issue that doesn't appear to be slated for a fix.

Examining our /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh file on a Beanstalked instance shows that this file is now radically different than the example scripts presented when the workaround was first introduced. Our Beanstalk environment executes a python script which has DEFAULT_HOME='/tmp' set, which may be a problem many people experience deploying to EB going forward.

The fix was to create a file in the root of our nodejs application named .ebextensions/0001-home.config with the following contents:

container_commands:  
    01-set-home-dir:
        command: "export HOME=/tmp"

Specifically our problem was installing the memcached module which depended on the hashring module.