docker-lambda icon indicating copy to clipboard operation
docker-lambda copied to clipboard

[GitHub Actions] Cannot find module 'color'

Open screendriver opened this issue 6 years ago • 0 comments

I'm using GitHub Actions to run integration tests against your Docker image. Locally on my MacBook everything works fine but when they run in my GitHub Actions workflow I get following response:

{
  "errorType": "Runtime.ImportModuleError",
  "errorMessage": "Error: Cannot find module 'color'\nRequire stack:\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js"
}

My .github/workflows/build.yml looks like this:

name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    services:
      lambda:
        image: lambci/lambda:nodejs12.x
        ports:
          - 9001:9001
        volumes:
          - $PWD:/var/task:ro,delegated
        env:
          DOCKER_LAMBDA_STAY_OPEN: 1
          AWS_LAMBDA_FUNCTION_HANDLER: lambda/my-test.handler
    steps:
      - ...

screendriver avatar Jan 03 '20 10:01 screendriver