inxilpro / node-app-root-path

Determine the root path to your project
MIT License
605 stars 29 forks source link

Not returning the correct app path on AWS Lambda #23

Closed motocombotag closed 6 years ago

motocombotag commented 6 years ago

Fix it please. It wasted 2 days of my time.

inxilpro commented 6 years ago

Hm. I can try to help, but you’re going to need to provide a little more detail, and maybe try asking in a less entitled way. No one forced you to use my free, open source library. Most open source maintainers would probably just close an issue like this without any response.

motocombotag commented 6 years ago

You're right. I apologize. I was that much frustrated. I didn't use your library directly - it was used by phantomjs which I used in a project and after some time-wasting, I realized that the path that is logged on AWS Lambda is /var/runtime/awslambda or something like that, while the actual Lambda function runs in /var/task.

jrtipton commented 6 years ago
  if (process.env.LAMBDA_TASK_ROOT && process.env.AWS_EXECUTION_ENV) {
    return process.env.LAMBDA_TASK_ROOT;
  }

...is one way to fix it

inxilpro commented 6 years ago

Fixed by #24