Error: spawn git ENOENT in AWS Lambda
See original GitHub issueconst git = require('simple-git/promise');
await git().clone(remoteAddr, `/tmp/${asset}`);
This results into:
2020-05-23T15:51:16.890Z 0feb02af-cce3-4f70-ab11-5dae09994edf ERROR Invoke Error {"errorType":"Error","errorMessage":"Error: spawn git ENOENT\n at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)\n at onErrorNT (internal/child_process.js:469:16)\n at processTicksAndRejections (internal/process/task_queues.js:84:21)","task":{"concatStdErr":false,"format":"utf-8","commands":["clone","https://bitbucket.mycompany.org/scm/hps/serverless.git","/tmp/bootstrap"]},"stack":["Error: Error: spawn git ENOENT"," at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)"," at onErrorNT (internal/child_process.js:469:16)"," at processTicksAndRejections (internal/process/task_queues.js:84:21)"," at GitExecutor.<anonymous> (/var/task/node_modules/simple-git/src/lib/git-executor.js:35:23)"," at Generator.throw (<anonymous>)"," at rejected (/var/task/node_modules/simple-git/src/lib/git-executor.js:6:65)"]}
Has this been tested on Lambda? I am sure there are no permission issues or anything like that.
Please help!
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top GitHub Comments
Hi @destinyb-realityi I was able to resolve it, you might not have git installed in lambda. First you need to have git available in your AWS lambda, please refer: [(https://github.com/lambci/git-lambda-layer)] and attach this git layer to your lambda. then you can use this API. hope this helps. if it worked on your local, it will work on lambda as well. All the best!
This issue has been automatically closed due to a lack of response. If your problem persists please open a new issue including any additional detail requested from this issue. For more detail on the issues/pull requests see ISSUES_AND_PULL_REQUESTS