
使用 AWS Elastic Beanstalk,我选择启动一个运行 NodeJS 的实例。EC2 实例已启动,但当我检查正在运行的节点版本时,我得到了以下信息:
node --version
-bash: node: command not found
我的 EC2 实例 AMI ID
aws-elasticbeanstalk-amzn-2015.09.2.x86_64-nodejs-pv-201602232224 (ami-ae3fddce)
答案1
AMI 映像默认不会将节点添加到 bash PATH。
您可以在 /bin 中添加一个符号链接,使用以下 bash 命令指向节点。
sudo ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/node /bin/node