Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting spawn node ENOENT in pm2

I was trying to setup strapi on AWS

I was following the instructions listed on their site: https://strapi.io/documentation/3.0.0-beta.x/deployment/amazon-aws.html

Here is my folder structure

enter image description here

And this would be my ecoystem.config.js file

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',
      },
    },
  ],
};

Is aws Master username equivalent to DATABASE_USERNAME in the above? because master username is r123_strapi_101

When I run pm2 start ecosystem.config.js i get this error

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)

Can someone please help me in fixing this or what I could be doing wrong?

like image 259
anny123 Avatar asked Nov 16 '22 05:11

anny123


1 Answers

I managed to fix it by reinstalling Node.js and renaming my app in my ecoystem.config.js file, from "strapi-test" to "strapi-test-app". For some reason, the first config never started.

Console output pm2 list:

Console output pm2 list

like image 171
Diegoazaratean Avatar answered Dec 06 '22 13:12

Diegoazaratean