th-ch / youtube-music

YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)
https://th-ch.github.io/youtube-music/
MIT License
7.02k stars 427 forks source link

[partially works] doesn't build for linux armhf/arm64 #85

Open Itai-Nelken opened 3 years ago

Itai-Nelken commented 3 years ago

doesn't build on Ubuntu arm64 for Raspberry Pi

steps I followed: 1) git clone https://github.com/th-ch/youtube-music 2) cd youtube-music 3) yarn 4) yarn start (to start the app)

when running yarn I get this error:

00h00m00s 0/0: : ERROR: There are no scenarios; must have at least one.
Itai-Nelken commented 3 years ago

I think i fixed the issue by installing yarn using the instructions on the official website

Itai-Nelken commented 3 years ago

works perfectly ok. but I did get one error:

itai@UbuntuPi4-ultra-4gb:~/youtube-music$ yarn
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "yargs-parser@18.1.3" is incompatible with requested version "yargs-parser@^4.2.0"
[3/5] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @cliqz/adblocker-electron@1.18.6" has incorrect peer dependency "electron@^v10.1.5".
warning "@cliqz/adblocker-electron > @cliqz/adblocker-electron-preload@1.18.6" has incorrect peer dependency "electron@^v10.1.5".
warning "xo > eslint-import-resolver-webpack@0.12.1" has unmet peer dependency "webpack@>=1.11.0".
[5/5] Building fresh packages...
[1/6] ⡀ registry-js
[4/6] ⡀ electron
[3/6] ⡀ phantomjs-prebuilt
[5/6] ⢀ electron-chromedriver
error /home/itai/youtube-music/node_modules/phantomjs-prebuilt: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /home/itai/youtube-music/node_modules/phantomjs-prebuilt
Output:
PhantomJS not found on PATH
Unexpected platform or architecture: linux/arm64

is that anything bad, or can I ignore it? also how can I package (to deb or AppImage)?

Anyway, thank you for this great app!

Itai-Nelken commented 3 years ago

it always starts up with the DevTools open even though they are disabled

Itai-Nelken commented 3 years ago

and the addblocker doesn't work. it did work on my mac, so I guess it isn't something to do with the app.

th-ch commented 3 years ago

Hey @Itai-Nelken, thanks for the feedback! I never tried on ARM64 but in all cases phantomJS should not be required, because it is a dev dependency (useful for dev but not to build the app) - if you only want to build, you can try:

yarn --frozen-lockfile
yarn build:linux

Not sure if will work on electron/electron-builder side (current electron version of the project is 10 while latest version is 11) but worth giving it a try!

Itai-Nelken commented 3 years ago

Thanks a lot! will this also work on armhf (arm 32 bit)? I'll try anyway.

if you need any help with testing on ARM64 and ARMHF i can help you.

Itai-Nelken commented 3 years ago

when running yarn build:linux I get this error:

yarn run v1.22.5
$ yarn run clean && electron-builder --linux
$ rimraf dist
/bin/sh: 1: rimraf: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Itai-Nelken commented 3 years ago

I tried building again, and I got this error when running yarn --prod --frozen-lockfile:

pi@Twisterpi4-ultra-4gb:~/youtube-music $ yarn --prod --frozen-lockfile
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "yargs-parser@18.1.3" is incompatible with requested version "yargs-parser@^4.2.0"
[3/5] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @cliqz/adblocker-electron@1.18.6" has incorrect peer dependency "electron@^v10.1.5".
warning "@cliqz/adblocker-electron > @cliqz/adblocker-electron-preload@1.18.6" has incorrect peer dependency "electron@^v10.1.5".
warning "xo > eslint-import-resolver-webpack@0.12.1" has unmet peer dependency "webpack@>=1.11.0".
[5/5] Building fresh packages...
$ yarn run icon && yarn run plugins
yarn run v1.22.5
$ rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated
/bin/sh: 1: rimraf: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
pi@Twisterpi4-ultra-4gb:~/youtube-music $ 
th-ch commented 3 years ago

@Itai-Nelken Apologies, you actually need all dependencies to build the app (I edited my previous comment) so command is yarn --frozen-lockfile before yarn build:linux (but the phantomJS error should not be a blocker to build 🤞)

Itai-Nelken commented 3 years ago

@th-ch still doesn't work. here is the terminal output of yarn --frozen-lockfile:

pi@Twisterpi4-ultra-4gb:~/Downloads/youtube-music $ yarn --frozen-lockfile
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "yargs-parser@18.1.3" is incompatible with requested version "yargs-parser@^4.2.0"
[3/5] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @cliqz/adblocker-electron@1.18.6" has incorrect peer dependency "electron@^v10.1.5".
warning "@cliqz/adblocker-electron > @cliqz/adblocker-electron-preload@1.18.6" has incorrect peer dependency "electron@^v10.1.5".
warning "xo > eslint-import-resolver-webpack@0.12.1" has unmet peer dependency "webpack@>=1.11.0".
[5/5] Building fresh packages...
[1/6] ⠠ registry-js
[4/6] ⠠ electron
[3/6] ⠠ phantomjs-prebuilt
[5/6] ⠠ electron-chromedriver
error /home/pi/Downloads/youtube-music/node_modules/phantomjs-prebuilt: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /home/pi/Downloads/youtube-music/node_modules/phantomjs-prebuilt
Output:
PhantomJS not found on PATH
Unexpected platform or architecture: linux/arm

pi@Twisterpi4-ultra-4gb:~/Downloads/youtube-music $ 

and yarn build:linux:

pi@Twisterpi4-ultra-4gb:~/Downloads/youtube-music $ yarn build:linux
yarn run v1.22.5
$ yarn run clean && electron-builder --linux
$ rimraf dist
  • electron-builder  version=22.8.1 os=5.4.79-v7l+
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  ⨯ Unsupported arch arm  stackTrace=
                            Error: Unsupported arch arm
                                at archFromString (/home/pi/Downloads/youtube-music/node_modules/builder-util/src/arch.ts:43:13)
                                at computeArchToTargetNamesMap (/home/pi/Downloads/youtube-music/node_modules/app-builder-lib/src/targets/targetFactory.ts:43:20)
                                at Packager.doBuild (/home/pi/Downloads/youtube-music/node_modules/app-builder-lib/src/packager.ts:429:41)
                                at Packager._build (/home/pi/Downloads/youtube-music/node_modules/app-builder-lib/src/packager.ts:373:57)
                                at Packager.build (/home/pi/Downloads/youtube-music/node_modules/app-builder-lib/src/packager.ts:337:12)
                                at executeFinally (/home/pi/Downloads/youtube-music/node_modules/builder-util/src/promise.ts:12:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
pi@Twisterpi4-ultra-4gb:~/Downloads/youtube-music $ 
Itai-Nelken commented 3 years ago

btw I'm using a armhf (32bit) OS now(RaspberryPi OS, debian)

Itai-Nelken commented 3 years ago

@th-ch I managed to build the app on Linux (armv7l(armhf))! here are the steps:

git clone https://github.com/th-ch/youtube-music.git
cd youtube-music
yarn --frozen-lockfile
yarn build:linux --linux appimage --armv7l

change --armv7l with --arm64 to build a arm 64bit AppImage. the appimage will be in youtube-music/dist.

Itai-Nelken commented 3 years ago

here is a screenshot: Screenshot_2020-12-30_12-47-03 I'm running the app on a RaspberryPi 4 4gb running TwisterOS.

Itai-Nelken commented 3 years ago

@th-ch now I get a error when trying to download music, here is a screenshot: youtube-music-error

th-ch commented 3 years ago

Hey @Itai-Nelken, thank you for the detailed feedback! Glad to see it working 😃 For the downloader issue, the mp3 conversion is done with the WebAssembly version of FFmpeg and not sure of how well it is supported on ARM 😬 - I don't have an ARM machine at the moment to test, keeping the issue opened to track progress on this!

Itai-Nelken commented 3 years ago

@th-ch I tried installing it using

git clone https://github.com/ffmpegwasm/ffmpeg.wasm.git
cd ffmpeg.wasm
npm install @ffmpeg/ffmpeg @ffmpeg/core --armv7l

and it installed successfully, but I still get the same error when trying to download...

also I have a spare pi that I can set up with remote desktop for you if you want.

Itai-Nelken commented 3 years ago

I tried a few more thing. here is what I did (keep in mind I hardly have any idea what I'm doing, so I might be doing really stupid things): I tried installingffmpeg.wasm with yarn: yarn add @ffmpeg/ffmpeg download still doesn't work, same error. I changed to the youtube-music folder and ran that command again, then I built the app again - same error when downloading...

Itai-Nelken commented 3 years ago

here are the build instructions for linux arm so far (I added everything I did, so there might be some uneeded instructions):

Install dependencies

node.js

There are two ways to install node.js: using apt and the nodesource repo and using nvm (node version manager), I recommend using nvm because using the nodesource repo has broken system permissions multiple times for me.

curl is needed, but you can change it with wget if you use the correct flags.

nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
nvm install node

nodesource

curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -
sudo apt install nodejs -y

yarn


curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn -y

build youtube music

git clone https://github.com/th-ch/youtube-music.git
cd youtube-music
yarn --frozen-lockfile

build a appimage

yarn build:linux --linux appimage --armv7l

build a deb

yarn build:linux --linux deb --armv7l

I had to run yarn --frozen lockfile, yarn build:linux --linux appimage --armv7l & yarn build:linux --linux deb --armv7l as root. otherwise the commands failed. change armv7l with arm64 for building for Linux arm64.

notes

JellyBrick commented 9 months ago

Related to https://github.com/electron-userland/electron-builder/issues/5626