Npm fails while installing jitsi-meet

Hi,

Which node version should be used now?

*NOTE: When installing on older distributions keep in mind that you need Node.js >= 12 and npm >= 6.*

I have node LTS 12.18 installed and it throws the same error with the “npm install” command.

Any suggestions? I need this server running for today’s classes :exploding_head:

My settings are:

Ubuntu 18.04
# node -v
v12.18.0
# npm version
{
  npm: '6.14.4',
  ares: '1.16.0',
  brotli: '1.0.7',
  cldr: '37.0',
  http_parser: '2.9.3',
  icu: '67.1',
  llhttp: '2.0.4',
  modules: '72',
  napi: '6',
  nghttp2: '1.41.0',
  node: '12.18.0',
  openssl: '1.1.1g',
  tz: '2019c',
  unicode: '13.0',
  uv: '1.37.0',
  v8: '7.8.279.23-node.37',
  zlib: '1.2.11'
}

This is the error:

- node-sass@4.14.1 install /srv/jitsi-meet/node_modules/node-sass
- node scripts/install.js
Unable to save binary /srv/jitsi-meet/node_modules/node-sass/vendor/linux-x64-72 : Error: EACCES: permission denied, mkdir '/srv/jitsi-meet/node_modules/node-sass/vendor'
    at Object.mkdirSync (fs.js:914:3)
    at sync (/srv/jitsi-meet/node_modules/mkdirp/index.js:72:13)
    at Function.sync (/srv/jitsi-meet/node_modules/mkdirp/index.js:78:24)
    at checkAndDownloadBinary (/srv/jitsi-meet/node_modules/node-sass/scripts/install.js:114:11)
    at Object.<anonymous> (/srv/jitsi-meet/node_modules/node-sass/scripts/install.js:157:1)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/srv/jitsi-meet/node_modules/node-sass/vendor'
}

- final-form@4.12.0 postinstall /srv/jitsi-meet/node_modules/final-form
- node -e "console.log('\u001b[35m\u001b[1mUsing final-form at work? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/final-form/donate\u001b[0m')"

Using final-form at work? You can now donate to our open collective:
- https://opencollective.com/final-form/donate

- styled-components@3.4.9 postinstall /srv/jitsi-meet/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

-lib-jitsi-meet@github:jitsi/lib-jitsi-meet#6af8eee57d1ebdc0881c8c2875d4346e02d01549 postinstall /srv/jitsi-meet/node_modules/lib-jitsi-meet
-webpack -p

Error: EACCES: permission denied, open '/srv/jitsi-meet/node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lib-jitsi-meet@github:jitsi/lib-jitsi-meet#6af8eee57d1ebdc0881c8c2875d4346e02d01549 postinstall: `webpack -p`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lib-jitsi-meet@github:jitsi/lib-jitsi-meet#6af8eee57d1ebdc0881c8c2875d4346e02d01549 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-06-08T07_54_23_741Z-debug.log

And these are the last log entries:

55933 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
55934 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
55935 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
55935 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
55935 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
55935 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
55936 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/chokidar/node_modules/fsevents):
55937 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
55938 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
55938 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
55938 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
55938 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
55939 verbose stack Error: lib-jitsi-meet@github:jitsi/lib-jitsi-meet#6af8eee57d1ebdc0881c8c2875d4346e02d01549 postinstall: `webpack -p`
55939 verbose stack Exit status 1
55939 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/nodejs/node-v12.18.0-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
55939 verbose stack     at EventEmitter.emit (events.js:315:20)
55939 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/nodejs/node-v12.18.0-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
55939 verbose stack     at ChildProcess.emit (events.js:315:20)
55939 verbose stack     at maybeClose (internal/child_process.js:1021:16)
55939 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
55940 verbose pkgid lib-jitsi-meet@github:jitsi/lib-jitsi-meet#6af8eee57d1ebdc0881c8c2875d4346e02d01549
55941 verbose cwd /srv/jitsi-meet
55942 verbose Linux 4.15.0-101-generic
55943 verbose argv "/usr/local/lib/nodejs/node-v12.18.0-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v12.18.0-linux-x64/bin/npm" "install"
55944 verbose node v12.18.0
55945 verbose npm  v6.14.4
55946 error code ELIFECYCLE
55947 error errno 1
55948 error lib-jitsi-meet@github:jitsi/lib-jitsi-meet#6af8eee57d1ebdc0881c8c2875d4346e02d01549 postinstall: `webpack -p`
55948 error Exit status 1
55949 error Failed at the lib-jitsi-meet@github:jitsi/lib-jitsi-meet#6af8eee57d1ebdc0881c8c2875d4346e02d01549 postinstall script.
55949 error This is probably not a problem with npm. There is likely additional logging output above.
55950 verbose exit [ 1, true ]

If you are installing you should use the binary packages and follow the quick install guide

First it is not good idea to run those commands as root. Maybe your problems with permissions will be solved if you delete /srv/jitsi-meet/node_modules and try again. Or better checkout as a normal user and execute the commands as a normal user and not as root.

Thanks for answer @damencho

I tried removing the /srv/jitsi-meet/node_modules folder but the problem persists. I also tried a new installation with a non-root user but the same error result at this step.

I found that file lib-jitsi-meet.min.js does not exist.

:/srv# ls -la /srv/jitsi-meet/node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js
ls: cannot access '/srv/jitsi-meet/node_modules/lib-jitsi-meet/lib-jitsi-meet.min.js': No such file or directory

There is also no “lib-jitsi-meet” folder:

:/srv/jitsi-meet$ ls -la node_modules/lib-jitsi-meet/
ls: cannot access 'node_modules/lib-jitsi-meet/': No such file or directory