Js-utils missing when make-ing Jitsi Meet

This is probably related to this GitHub issue, but I wasn’t able to find any answer:

I have followed the build instructions in the README file (I ran npm install).

The full make output is below:

./node_modules/.bin/webpack -p
Hash: 28b4621e227988172258456e12368faa6e806ec1
Version: webpack 4.26.1
Child
    Hash: 28b4621e227988172258
    Time: 48314ms
    Built at: 04/20/2019 12:24:19 PM
     14 assets
    Entrypoint app.bundle = app.bundle.min.js app.bundle.min.map
    Entrypoint device_selection_popup_bundle = device_selection_popup_bundle.min.js device_selection_popup_bundle.min.map
    Entrypoint alwaysontop = alwaysontop.min.js alwaysontop.min.map
    Entrypoint dial_in_info_bundle = dial_in_info_bundle.min.js dial_in_info_bundle.min.map
    Entrypoint do_external_connect = do_external_connect.min.js do_external_connect.min.map
    Entrypoint flacEncodeWorker = flacEncodeWorker.min.js flacEncodeWorker.min.map
    Entrypoint analytics-ga = analytics-ga.min.js analytics-ga.min.map
     [24] ./react/features/base/util/index.js + 1 modules 678 bytes {1} {2} {3} {4} {5} [built]
          | ./react/features/base/util/index.js 108 bytes [built]
          | ./react/features/base/util/loadScript.web.js 555 bytes [built]
     [96] ./react/features/base/config/parseURLParams.js 1.4 KiB {2} {3} {4} {5} [built]
     [99] ./react/features/local-recording/recording/flac/messageTypes.js 1.05 KiB {2} {3} {6} [built]
    [389] ./react/features/base/config/getRoomName.js 709 bytes {2} {3} {5} [built]
    [402] ./react/features/analytics/handlers/AbstractHandler.js 1.67 KiB {1} {2} {3} [built]
    [696] ./conference.js 80 KiB {2} [built]
    [700] ./modules/keyboardshortcut/keyboardshortcut.js 6.16 KiB {2} [built]
    [701] ./modules/remotecontrol/RemoteControl.js 2.34 KiB {2} [built]
    [738] multi ./react/features/invite/components/dial-in-info-page 28 bytes {4} [built]
    [739] ./connection_optimization/do_external_connect.js 2.32 KiB {5} [built]
    [740] ./react/features/local-recording/recording/flac/flacEncodeWorker.js 9.1 KiB {6} [built]
    [741] ./react/features/analytics/handlers/GoogleAnalyticsHandler.js 4.25 KiB {1} [built]
    [745] ./react/features/always-on-top/index.js + 3 modules 7.1 KiB {0} [built]
          | ./react/features/always-on-top/index.js 364 bytes [built]
          | ./react/features/always-on-top/AlwaysOnTop.js 5.09 KiB [built]
          | ./react/features/always-on-top/Toolbar.js 915 bytes [built]
          | ./react/features/always-on-top/HangupButton.js 750 bytes [built]
    [748] ./app.js + 2 modules 2.84 KiB {2} [built]
          | ./app.js 1.54 KiB [built]
          | ./modules/API/index.js 90 bytes [built]
          | ./modules/translation/translation.js 1.15 KiB [built]
    [753] ./react/features/settings/popup.js + 1 modules 8.44 KiB {3} [built]
          | ./react/features/settings/popup.js 315 bytes [built]
          |     + 1 hidden module
        + 762 hidden modules
    
    ERROR in ./react/features/app/getRouteToRender.js
    Module not found: Error: Can't resolve 'js-utils/random' in '/home/build/jitsi-meet/react/features/app'
     @ ./react/features/app/getRouteToRender.js 1:0-63 83:26-54
     @ ./react/features/app/middleware.js
     @ ./react/features/app/index.js
     @ ./conference.js
     @ ./app.js
    
    ERROR in ./react/features/base/participants/reducer.js
    Module not found: Error: Can't resolve 'js-utils/random' in '/home/build/jitsi-meet/react/features/base/participants'
     @ ./react/features/base/participants/reducer.js 5:0-50 195:28-43
     @ ./react/features/base/participants/index.js
     @ ./conference.js
     @ ./app.js
    
    ERROR in ./react/features/base/settings/reducer.js
    Module not found: Error: Can't resolve 'js-utils/random' in '/home/build/jitsi-meet/react/features/base/settings'
     @ ./react/features/base/settings/reducer.js 5:0-50 107:15-30
     @ ./react/features/base/settings/index.js
     @ ./conference.js
     @ ./app.js
    
    ERROR in ./react/features/calendar-sync/actions.web.js
    Module not found: Error: Can't resolve 'js-utils/random' in '/home/build/jitsi-meet/react/features/calendar-sync'
     @ ./react/features/calendar-sync/actions.web.js 1:0-63 218:24-52
     @ ./react/features/calendar-sync/index.js
     @ ./react/features/welcome/components/WelcomePage.web.js
     @ ./react/features/welcome/components/index.js
     @ ./react/features/welcome/index.js
     @ ./react/features/app/getRouteToRender.js
     @ ./react/features/app/middleware.js
     @ ./react/features/app/index.js
     @ ./conference.js
     @ ./app.js
    
    ERROR in ./react/features/overlay/components/AbstractPageReloadOverlay.js
    Module not found: Error: Can't resolve 'js-utils/random' in '/home/build/jitsi-meet/react/features/overlay/components'
     @ ./react/features/overlay/components/AbstractPageReloadOverlay.js 1:0-44 70:32-41
     @ ./react/features/overlay/components/web/PageReloadOverlay.js
     @ ./react/features/overlay/components/web/index.js
     @ ./react/features/overlay/overlays.web.js
     @ ./react/features/overlay/functions.js
     @ ./react/features/overlay/index.js
     @ ./conference.js
     @ ./app.js
    
    ERROR in ./react/features/welcome/components/AbstractWelcomePage.js
    Module not found: Error: Can't resolve 'js-utils/random' in '/home/build/jitsi-meet/react/features/welcome/components'
     @ ./react/features/welcome/components/AbstractWelcomePage.js 3:0-63 190:30-58
     @ ./react/features/welcome/components/WelcomePage.web.js
     @ ./react/features/welcome/components/index.js
     @ ./react/features/welcome/index.js
     @ ./react/features/app/getRouteToRender.js
     @ ./react/features/app/middleware.js
     @ ./react/features/app/index.js
     @ ./conference.js
     @ ./app.js
Child
    Hash: 456e12368faa6e806ec1
    Time: 8635ms
    Built at: 04/20/2019 12:23:40 PM
                   Asset      Size  Chunks             Chunk Names
     external_api.min.js  27.7 KiB       0  [emitted]  external_api
    external_api.min.map   140 KiB       0  [emitted]  external_api
    Entrypoint external_api = external_api.min.js external_api.min.map
     [0] ./modules/API/external/functions.js 3.96 KiB {0} [built]
     [2] ./react/features/base/util/uri.js 12.7 KiB {0} [built]
     [3] ./modules/transport/index.js + 7 modules 16.3 KiB {0} [built]
         | ./modules/transport/index.js 1.33 KiB [built]
         | ./react/features/base/util/index.js 108 bytes [built]
         | ./modules/API/constants.js 626 bytes [built]
         | ./modules/transport/PostMessageTransportBackend.js 5.57 KiB [built]
         | ./modules/transport/Transport.js 6.46 KiB [built]
         | ./react/features/base/util/loadScript.web.js 555 bytes [built]
         | ./react/features/base/config/parseURLParams.js 1.4 KiB [built]
         | ./modules/transport/constants.js 328 bytes [built]
     [5] ./react/features/base/util/helpers.js 1.37 KiB {0} [built]
     [6] ./react/features/base/util/httpUtils.js 670 bytes {0} [built]
     [9] ./modules/API/external/electronPopupsConfig.json 285 bytes {0} [built]
    [10] ./modules/API/external/index.js 171 bytes {0} [built]
    [11] ./modules/API/external/external_api.js 26.9 KiB {0} [built]
        + 5 hidden modules
Makefile:18: recipe for target 'compile' failed

Any ideas what’s going wrong?

Your help is much appreciated, thank you.

All the best,
Philipp

Have you tried deleting node_modules and doing npm install again?

How would I delete node_modules? (Sorry no expert on these frameworks at all!)

cd jitsi-meet
rm -rf node_modules

Nope, that didn’t work. The same error occurs!

Do you have any modifications?

Nope. I just git clone’d and ran the compilation as outlined here:

npm -version
3.5.2
nodejs -v
v8.10.0
lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

What do you see in node_modules/js-utils? Do you really not see the “random” folder? If you don’t, could you check node_modules/js-utils/package.json if the commit sha is 73a67a7a60d52f8e895f50939c8fcbd1f20fe7b5?

Cloning and npm installing gives this.

build@main-server-1:~$ git clone https://github.com/jitsi/jitsi-meet.git jitsi-meet-build
Cloning into 'jitsi-meet-build'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 58441 (delta 2), reused 2 (delta 0), pack-reused 58433
Receiving objects: 100% (58441/58441), 32.99 MiB | 19.60 MiB/s, done.
Resolving deltas: 100% (37793/37793), done.
build@main-server-1:~$ cd jitsi-meet-build/
build@main-server-1:~/jitsi-meet-build$ npm install


> git-validate@2.2.4 install /home/build/jitsi-meet-build/node_modules/git-validate
> node bin/install


> precommit-hook@3.0.0 install /home/build/jitsi-meet-build/node_modules/precommit-hook
> node bin/install


> node-sass@4.10.0 install /home/build/jitsi-meet-build/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/build/.npm/node-sass/4.10.0/linux-x64-57_binding.node

> styled-components@3.4.9 postinstall /home/build/jitsi-meet-build/node_modules/styled-components
> node ./scripts/postinstall.js || exit 0

Use styled-components at work? Consider supporting our development efforts at opencollective.com/styled-components

> node-sass@4.10.0 postinstall /home/build/jitsi-meet-build/node_modules/node-sass
> node scripts/build.js

Binary found at /home/build/jitsi-meet-build/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine

> lib-jitsi-meet@0.0.0 postinstall /home/build/jitsi-meet-build/node_modules/lib-jitsi-meet
> webpack -p

npm WARN optional Skipping failed optional dependency /sane/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.8
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.8
npm WARN @atlaskit/inline-dialog@5.3.0 requires a peer of react@15.6.0 - 16.2.0 but none was installed.
npm WARN @atlaskit/inline-dialog@5.3.0 requires a peer of react-dom@15.6.0 - 16.2.0 but none was installed.
npm WARN @atlaskit/theme@2.4.1 requires a peer of react@15.6.0 - 16.2.0 but none was installed.
npm WARN @atlaskit/layer@2.9.1 requires a peer of react@15.6.0 - 16.2.0 but none was installed.

No random folder in node_modules/js-utils.

build@main-server-1:~/jitsi-meet-build$ ll node_modules/js-utils/
total 160
drwxrwxr-x   6 build build  4096 Apr 24 01:21 ./
drwxrwxr-x 992 build build 36864 Apr 24 01:23 ../
drwxrwxr-x   2 build build  4096 Apr 24 01:19 avatar/
drwxrwxr-x   2 build build  4096 Apr 24 01:20 browser-capabilities/
drwxrwxr-x   2 build build  4096 Apr 24 01:20 browser-detection/
-rw-rw-r--   1 build build    75 Apr 24 01:19 .eslintrc.js
-rw-rw-r--   1 build build  1254 Apr 24 01:19 .flowconfig
-rw-rw-r--   1 build build   103 Apr 24 01:19 index.js
-rw-rw-r--   1 build build 11358 Apr 24 01:19 LICENSE
drwxrwxr-x   3 build build  4096 Apr 24 01:21 node_modules/
-rw-rw-r--   1 build build   138 Apr 24 01:19 .npmignore
-rw-rw-r--   1 build build  2780 Apr 24 01:20 package.json
-rw-rw-r--   1 build build 61544 Apr 24 01:19 package-lock.json
-rw-rw-r--   1 build build    58 Apr 24 01:19 README.md

I’ve checked the SHA of the git commit of HEAD:

build@main-server-1:~/jitsi-meet-build$ git rev-parse HEAD
4c286b8580a2031904f0b78460b2544cf4390196
build@main-server-1:~/jitsi-meet-build$ git checkout 73a67a7a60d52f8e895f50939c8fcbd1f20fe7b5
fatal: reference is not a tree: 73a67a7a60d52f8e895f50939c8fcbd1f20fe7b5

The 73a67a7 would be for js-utils, not jitsi-meet. If you look in jitsi-meet/package.json you should see a reference to js-utils which tries to get sha for js-utils. If you look in jitsi-meet/node_modules/js-utils/package.json I would expect it to be self listed as sha 73a67a7.

Indeed, in jitsi-meet-build/package.json:

"js-utils": "github:jitsi/js-utils#73a67a7a60d52f8e895f50939c8fcbd1f20fe7b5"

And jitsi-meet-build/node_modules/js-utils/package.json contains:

"_args": [
    [
      "js-utils@github:jitsi/js-utils#73a67a7a60d52f8e895f50939c8fcbd1f20fe7b5",
      "/home/build/jitsi-meet-build"
    ]
  ],
  "_from": "jitsi/js-utils#73a67a7a60d52f8e895f50939c8fcbd1f20fe7b5",
  ...

So all of this seems to be in order. Yet, I’m getting this compile error.

Best,
Philipp

At the same time, I can do

build@main-server-1:~$ git clone https://github.com/jitsi/js-utils.git
Cloning into 'js-utils'...
remote: Enumerating objects: 26, done.
remote: Counting objects: 100% (26/26), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 92 (delta 7), reused 18 (delta 6), pack-reused 66
Unpacking objects: 100% (92/92), done.
build@main-server-1:~$ ls
jitsi-meet  jitsi-meet-build  js-utils
build@main-server-1:~$ cd js-utils/
build@main-server-1:~/js-utils$ ls
avatar  browser-capabilities  browser-detection  index.js  LICENSE  package.json  package-lock.json  random  README.md
build@main-server-1:~/js-utils$ git rev-parse HEAD
73a67a7a60d52f8e895f50939c8fcbd1f20fe7b5

So when I git clone the repository from GitHub manually, it contains the random folder. But if I get it from npm install, it does not.

I would have guessed something bizarre is happening with my npm and node_js installation, but then somebody else raised the same problem as an issue on GitHub only about a month ago.

I’m having trouble downgrading my machine to the npm versions you’re on. Maybe the first step would be to upgrade it, and maybe node while you’re at it, and see if that resolves issues. (I use a package called nvm to jump between node versions.) I had gone down node 8.12.0, with npm 6.7.0, and could not repro the issue. Conjecturing out loud, it could be that because lib-jitsi-meet has a dependency on a version of js-utils without the /random folder, while jitsi-meet does that there is some conflict that npm cannot resolve and it chooses to use the old version.

Okay, so I’ve upgraded nodejs, and it started working! At least the build completes now without any issues and the random subfolder in js-utils exists.

I guess reading the README install instructions might help:

Node.js >= 10 and npm >= 6 are required.

I have to say though that this isn’t true:

On Debian/Ubuntu systems, the required packages can be installed with:

sudo apt-get install npm nodejs
cd jitsi-meet
npm install

In fact I had to follow this guide to install the latest LTS from the PPA.

Thanks a lot for your help! :slight_smile:

1 Like