【问题标题】:Use Node JS from php Elastic Beanstalk enviroment在 php Elastic Beanstalk 环境中使用 Node JS
【发布时间】:2018-03-01 22:48:11
【问题描述】:

我正在尝试使用 shell_exec 来运行这样的节点应用程序:

shell_exec(node app.js) ;

但我得到一个错误: sh:节点:找不到命令

我曾尝试使用这样的配置文件安装节点 js:

commands:
  01_node_install:
    # run this command from /tmp directory
    cwd: /tmp
    # don't run the command if node is already installed (file /usr/bin/node exists)
    test: '[ ! -f /usr/bin/node ] && echo "node not installed"'
    # install from epel repository
    # flag -y for no-interaction installation
    command: 'yum install -y nodejs --enablerepo=epel'

这是我的所有 env.config 文件,但我在 Elastic Beanstalk 日志中看不到任何与此相关的内容,问题仍然存在。 我怎么能在 php 环境中使用 Node JS !!

【问题讨论】:

    标签: php amazon-web-services amazon-ec2 amazon-elastic-beanstalk


    【解决方案1】:

    你的配置文件没问题。只需确保 env.config 位于项目根目录的 .ebextensions 文件夹中即可。

    【讨论】:

      猜你喜欢
      • 2017-05-24
      • 1970-01-01
      • 2020-10-23
      • 2018-12-02
      • 2015-09-18
      • 2015-07-13
      • 2021-09-29
      • 2018-07-24
      • 2015-10-23
      相关资源
      最近更新 更多