question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: spawn git ENOENT in AWS Lambda

See original GitHub issue
const 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
singhemantcommented, Aug 6, 2020

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!

0reactions
no-response[bot]commented, Jul 3, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

git clone, 'Error: spawn git ENOENT' · Issue #128 · steveukx/git-js
Hi, the ENOENT error is thrown when attempting to use the file system on a file that doesn't exist, most commonly this would...
Read more >
imagemin plugin throwing ENOENT error on aws lambda
The issue is that some packages are OS-dependent, meaning that the same package installed on different OSs are going to produce different ...
Read more >
Error: spawn git ENOENT in AWS Lambda - Bountysource
Error : spawn git ENOENT in AWS Lambda.
Read more >
Working with serverless applications - AWS Toolkit for VS Code
Learn how to create and use an AWS Serverless Application by using the AWS Toolkit for Visual Studio Code.
Read more >
How to fix this Error: spawn EACCES - Edward Beazer Blog
This error comes up when you don't have full permissions to the project folder. You want to run the chmod command in order...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found