Amazon Beanstalk installs node and npm into really obscure places - and I\'m not sure they won\'t change if EB decides to use a newer version of node, which would cause my appli
We had a similar issue with "node not found", trying to run node in container commands. After running ps aux
on the EC2 instance we saw that EB has access to the $NODE_HOME
env var:
su -s /bin/sh -c PATH=$PATH:$NODE_HOME/bin $EB_NODE_COMMAND 2>&1 nodejs
This can be used in .ebextensions, e.g.:
container_commands:
your_node_script:
command: 'env PATH="$PATH:$NODE_HOME/bin" ./bin/your_node_script'
(thanks to Alan Grow)