vadimdemedes / trevor

🚦 Your own mini Travis CI to run tests locally
MIT License
2.11k stars 51 forks source link

Trevor fails to detect Docker #84

Closed MaximDevoir closed 4 years ago

MaximDevoir commented 4 years ago

I've installed Trevor with npm install --global trevor.

When I run Trevor in a repository, I get the following error:

 $ trevor
 ✖ Docker must be running to run the tests

When I run docker -v

 $ docker -v
Docker version 19.03.4, build 9013bf583a

The result from is-docker-running is true.

The error is probably coming in main.js https://github.com/vadimdemedes/trevor/blob/4845c9cbb34230c376dbc2fed11ee9fa2d5d3fb1/lib/main.js#L72-L79

MaximDevoir commented 4 years ago

Maybe #81 fixes this.

NPM has an old version from this repository.

@vadimdemedes Can you update the package on NPM?

MaximDevoir commented 4 years ago

The reason Trevor is failing is because docker version (method for isDockerRunning on latest NPM package) may require root permissions. docker -v (merged from #81, but not published to NPM) does not require root permissions.

I was able to get the program to work, but I had to run Node and Trevor as root (probably not a good idea).

vadimdemedes commented 4 years ago

Done, published 2.4.1. Let me know if it fixes the issue.

MaximDevoir commented 4 years ago

I won't be able to test the latest published package. But, the published version should fix the issue. If I remember correctly, I ran a local version of Trevor with #81 merged and the error went away.