Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

Error: Cannot find module 'redis' in service container

Solved! Go to Solution.

I get the error: `Error: Cannot find module 'redis'` following this tutorial about connecting to redis service container.
I even tried with:

...

- name: Connect to Redis
        # Runs a script that creates a Redis client, populates
        # the client with data, and retrieves data
        run: |
          /usr/bin/docker exec -it redis  node ./.github/scripts/client.js
        # Environment variable used by the `client.js` script to create a new Redis client.
        env:
          # The hostname used to communicate with the Redis service container
          REDIS_HOST: redis
          # The default Redis port
          REDIS_PORT: 6379


but I get docker not found error.
Any idea please ?

2 Replies
Highlighted
Commander Lvl 1
Message 2 of 3

Re: Error: Cannot find module 'redis' in service container

Hey! Just to be clear, this tutorial should work out of the box: https://help.github.com/en/actions/configuring-and-managing-workflows/creating-redis-service-contain...

 

If that is not the case, please contact GitHub support so they can fix the example. I suggest starting with that example workflow and then building your custom stuff in.

 

I also suggest checking out: https://github.com/marketplace?utf8=✓&type=actions&query=redis One of these may provide a way for you to simplify your workflow.



*Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!*
Highlighted
Solution
Copilot Lvl 2
Message 3 of 3

Re: Error: Cannot find module 'redis' in service container

@logankilpatrick  thanks for your reply.
I find an example here showing how to solve it.