smartcontractkit / hardhat-chainlink

Integrates Chainlink into Hardhat projects. This package is currently in the BETA testing phase and is not recommended for production usage yet.
https://www.npmjs.com/package/@chainlink/hardhat-chainlink
MIT License
64 stars 31 forks source link

Error: spawn docker-compose ENOENT - Package incompatible with Docker Compose V2 #15

Open eloramirez1356 opened 1 month ago

eloramirez1356 commented 1 month ago

Describe the bug docker-compose is not working anymore because docker updated this command to docker compose, and then some commands of this library that are using docker-compose are not working anymore, like:

const { node } = hre.chainlink.sandbox;
await node.run();

To Reproduce In order to reproduce this, I am using MacOS with Docker version v4.32.0, and node version 18.20.3, and then running the following code:

const { node } = hre.chainlink.sandbox;
await node.run();

Where I find the following error:

Error: spawn docker-compose ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
error Command failed with exit code 1.

I was able to make it work by installing docker-compose using brew, but this step should not be needed and it was not needed before.

Expected behavior There should not be any error from running the code, as it was working before docker newer versions. For doing so it is needed to adapt the library code to use docker compose instead of docker-compose

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

zeuslawyer commented 1 month ago

thanks for raising this @eloramirez1356 ...will try and take a look.

BunsDev commented 5 days ago

@eloramirez1356 to verify, would making the following changes resolve the error?

  1. Update: "docker-compose" from dependencies (since we used the older version)
  2. Update: src/sandbox/node/index.ts
    • Replace: composeOptions where docker-composedocker compose

I envision this may not fully resolve issues, since docker-compose is used for the compose object.

Please try running this branch: issue/docker-compose and let me know how this can be improved upon to resolve the error. Or, better yet, please submit a PR with proposed changes, so we can make sure we are in alignment. Thanks so much!

eloramirez1356 commented 1 day ago

@BunsDev I will try to do it after a week or 2, and let you know as soon as I can! Thanks a lot! :)