Setting up best environment to build Brave for Android in 2021 and beyond

I would like to set up a development environment in order to build Brave for Android, as described at https://github.com/brave/brave-browser/wiki/Linux-Development-Environment.

I’d like to know mainly what distro is able to install all dependencies and all needed software.

I tried on Linux Mint 18.3 (based on Ubuntu 16.04 it seems…), where it had dependency problems:

Some packages could not be installed. This may mean that you have
distribution that some required packages have not yet been created
requested an impossible situation or if you are using the unstable

or been moved out of Incoming.
The following information may help to resolve the situation:The following packages have unmet dependencies:

      Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
npm : Depends: nodejs but it is not going to be installed
      Depends: node-ansi-color-table but it is not going to be installed
      ...
E: Unable to correct problems, you have held broken packages.
      Depends: node-which but it is not going to be installed

I also tried Ubunti 20.04, where it says it can’t find package libgnome-keyring-dev

I want to know your experience in building Brave for Android, and possible quirks, I hope it won’t come to having to build on my own…

Thanks in advance.

Update: I found all the packages were able to be installed witn Ubuntu 18.04, so that’s what I’m working with for now…

Update: I haven’t figured it out yet, but I learned a few things:

But there are some other quirks as for my experience.

It’s a long, long story… I ended up setting an Ubuntu 18.04 VM because of the libgnome-keyring-dev dependency. then i installed nodejs 14, as pero the page I linked to. It failed to install npm, as for the dependency error described in my very first post.

So, a workarount seems to be to first instal nodejs from default repo, then installed the latest nodejs LTS version from official npm repos.

But even then, it keeps failing to run either npm install or npm run init. Most errors common to me are ENOENTs

apk@apk-VirtualBox:~/Shared/brave-browser/src/brave$ npm install webpack@4.x.x webpack@^2.0.0 webpack@^2.0.0 jest@25
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.1.2 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN css-loader@2.1.1 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-cli@3.3.12 requires a peer of webpack@4.x.x but none is installed. You must install peer dependencies yourself.

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/apk/Shared/brave-browser/src/brave/node_modules/webpack/node_modules/supports-color/package.json.2635815583
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/apk/Shared/brave-browser/src/brave/node_modules/webpack/node_modules/supports-color/package.json.2635815583'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/apk/.npm/_logs/2021-04-15T11_53_40_499Z-debug.log

I’ve also had to install “peer dependencies” as for https://stackoverflow.com/a/49188160/7107690, but still, the same… It’s all I can say as for someone who known almost nothong about nodejs. I don’t know what else I can do…