在pm2中获取spawn节点ENOENT

iRo*_*tia 7 node.js pm2 strapi

我试图在 AWS 上设置 Strapi

我按照他们网站上列出的说明进行操作:https://strapi.io/documentation/3.0.0-beta.x/deployment/amazon-aws.html

这是我的文件夹结构

在此输入图像描述

这将是我的 ecoystem.config.js 文件

module.exports = {
  apps: [
    {
      name: 'my-project',
      cwd: '/home/ubuntu/Strapi',
      script: 'npm',
      args: 'start',
      env: {
        NODE_ENV: 'production',
        DATABASE_HOST: 'r123-strapi-database.ce7f.us-east-2.rds.amazonaws.com', // database Endpoint under 'Connectivity & Security' tab
        DATABASE_PORT: '5432',
        DATABASE_NAME: 'r123_Strapi_db', // DB name under 'Configuration' tab
        DATABASE_USERNAME: 'postgres', // default username
        DATABASE_PASSWORD: 'r123_strapi_pasW',
      },
    },
  ],
};
Run Code Online (Sandbox Code Playgroud)

aws Master 用户名是否等同于上面的 DATABASE_USERNAME ?因为主用户名是 r123_strapi_101

当我运行时 pm2 start ecosystem.config.js出现此错误

PM2        | 2020-09-07T20:04:11: PM2 error: Error: spawn node ENOENT
PM2        |     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
PM2        |     at onErrorNT (internal/child_process.js:469:16)
PM2        |     at processTicksAndRejections (internal/process/task_queues.js:84:21)
Run Code Online (Sandbox Code Playgroud)

有人可以帮我解决这个问题或者我可能做错了什么吗?

小智 1

我设法通过重新安装 Node.js 并在 ecoystem.config.js 文件中将我的应用程序从“strapi-test”重命名为“strapi-test-app”来修复它。由于某种原因,第一个配置从未启动。

控制台输出pm2列表:

控制台输出pm2列表