Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails with github actions #12

Closed
iwa opened this issue May 1, 2020 · 9 comments
Closed

Install fails with github actions #12

iwa opened this issue May 1, 2020 · 9 comments
Labels

Comments

@iwa
Copy link

iwa commented May 1, 2020

Please describe the problem you are having in as much detail as possible:
node-pre-gyp not found when installing the package on Github Actions

Include a reproducible code sample here, if possible:

yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /home/runner/work/Q-Bot/Q-Bot/node_modules/@discordjs/opus: Command failed.
Exit code: 1
Command: patch-package && node-pre-gyp install --fallback-to-build
Arguments: 
Directory: /home/runner/work/Q-Bot/Q-Bot/node_modules/@discordjs/opus
Output:
patch-package 6.2.2
Applying patches...
Error: Patch file found for package node-pre-gyp which is not present at node_modules/node-pre-gyp
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
##[error]Process completed with exit code 1.

Further details:

  • @discordjs/opus version: 0.2.1
  • Node.js version: v12
  • Operating system: ubuntu-latest
  • Priority this issue should have – please be realistic and elaborate if possible: Not that much important, but still annoying (might be my fault with my CI config)
@iwa iwa added the bug Something isn't working label May 1, 2020
@iCrawl
Copy link
Member

iCrawl commented May 1, 2020

That seems like a yarn issue, can you try npm?

@iwa
Copy link
Author

iwa commented May 1, 2020

still not working 🤔

Screen Shot 2020-05-01 at 15 23 30

my ci config file is available here (if needed) : https://github.com/iwaQwQ/Q-Bot/blob/feature/ci-update/.github/workflows/ci.yml

@iCrawl
Copy link
Member

iCrawl commented May 1, 2020

@iwa
Copy link
Author

iwa commented May 1, 2020

I'm still a newbie with Github Actions, so I may have made some dumb mistakes, sorry about that
I learnt CI configs with Gitlab, so i'm used to write the entire script on my own

I put every needed dependencies into devDep because I run multiple bots on my server, so instead of having to install libsodium for each bot, i've installed it globally.
Like that i don't have to install it on my pc or CIs host since i can install only dev dependencies with --only=dev.
But I think doing that is a mistake ?

@iCrawl
Copy link
Member

iCrawl commented May 1, 2020

Yeah, sadly thats not how things work in node.

Every package.json should list all the things it needs, otherwise we cant guarantee working conditions on packages, like the issue you have right now

@iwa
Copy link
Author

iwa commented May 1, 2020

Alrighty, thanks for the advice, I'll try again with the corrected list then

@iCrawl iCrawl added question and removed bug Something isn't working labels May 1, 2020
@iwa
Copy link
Author

iwa commented May 1, 2020

Alright, I've fixed my dependencies list, but it was still not working
After some tests, I figured out that it works by installing the dependencies with sudo rights (works both with npm and yarn as long as they have sudo rights)

The issue seems to be only on Github Actions, I tried to install the package on my mac (macOS 10.15.4) and my server, which runs on Debian 10, and everything worked well

Anyway, thanks for your help c:

I had another question, should I also install ffmpeg as a node dependency, or keeping it installed systemwide is fine ?

@iCrawl
Copy link
Member

iCrawl commented May 1, 2020

I figured out that it works by installing the dependencies with sudo rights

Using npm i --unsafe-perm usually does the trick here, no idea about yarn on that one though

I had another question, should I also install ffmpeg as a node dependency, or keeping it installed systemwide is fine ?

ffmpeg should be installed via the package manager of the distro you use whether that be brew, apt, pacman, dnf, yum etc. (on windows it should be https://ffmpeg.zeranoe.com/builds/)

@iwa
Copy link
Author

iwa commented May 1, 2020

yarn don't seems to have a similar option, so I think it only works with sudo rights when using yarn

i'm closing the issue since it's fixed, thanks for your help!

@iwa iwa closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants