Compiling Rocket.Chat Electron v3.1.1 for release (Win/Mac)

Hello everyone.
I hope someone can help me with this.
I am trying to compile the Desktop app version 3.1.1 for production with the command yarn release, as of the README here:

However, the resulting executables work neither on my Mac nor on my Windows.

On the Mac, I have Catalina 10.15.
The build process skips the Mac signing phase because I am not using an Apple Dev ID - however, I am not planning to publish my changes at this stage.
The process exits during building embedded block map file=dist/ with exit code 1 and no more details about the error. However the files are created.
But if I try to run the .app or the .dmg files, I see Rocket’s icon jumping in the tray for a few seconds and then disappearing.

On the Windows 10 machine (x64), running yarn release returns an error GitHub personal access token is not set, so I run instead yarn build; yarn electron-builder --publish never --x64.
The build completes with no errors, but still the executable Rocket.Chat.exe does not start. The installers seem to work, but after the installation, Rocket does not start. I get the error:
Cannot find module chokidar
So, I run npm install chokidar and again build and this time it cannot find rimraf. I install that too and it asks me for redux, then semver, and finally it asks me again for chokidar:

Error: Cannot find module 'chokidar'
Require stack:
- dist\win-unpacked\resources\app.asar\app\main.js
    at Module._resolveFilename (internal/modules/cjs/loader.js:961:15)
    at Function.o._resolveFilename (electron/js2c/browser_init.js:257:921)
    at Module._load (internal/modules/cjs/loader.js:844:27)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at dist\win-unpacked\resources\app.asar\app\main.js:736:103 {
  requireStack: [

Edit: I also tried yarn add chokidar instead of npm, but the result is the same. I still get this error.

If I use yarn start, the client works
Maybe I am missing some steps?


It seems the fix was easy. Simply, chokidar was listed in the devDependencies rather than the dependencies inside package.json.
Including it in dependencies too solved the problem.