Errors building jitsi from source

i get errors when building from source:

environment:
ubuntu 20
node -v && npm -v
v14.19.3
8.1.4
jitsi 2.0.7439

commands:
git clone GitHub - jitsi/jitsi-meet: Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
cd jitsi-meet
git checkout master
npm update
npm install → here errors

errors:
ERROR Failed to apply patch for package @giphy/js-analytics at path
Info:
Patch file: patches/@giphy+js-analytics+4.0.7.patch
Patch was made for version: 4.0.7
Installed version: 4.1.1

ERROR Failed to apply patch for package @giphy/js-brand at path
Info:
Patch file: patches/@giphy+js-brand+2.0.4.patch
Patch was made for version: 2.0.4
Installed version: 2.2.2

patch-package finished with 2 error(s).
npm ERR! code 1
npm ERR! path /opt/jitsi-meet
npm ERR! command failed
npm ERR! command sh -c patch-package --error-on-fail && jetify

how to solve this?

ok, i got solved it, just deleted the 2 patch files.

Do not run npm update it’s a terrible idea. You are updating our dependencies without any testing.

without an update,almost the same thing is happening

Ubuntu 18
8GB RAM
node: v16.15.1
npm :8.11.0

rm package-lock.json
npm install

then

ERROR Failed to apply patch for package @giphy/js-analytics at path

node_modules/@giphy/js-analytics

This error was caused because @giphy/js-analytics has changed since you
made the patch file for it. This introduced conflicts with your patch,
just like a merge conflict in Git when separate incompatible changes are
made to the same piece of code.

Maybe this means your patch file is no longer necessary, in which case
hooray! Just delete it!

Otherwise, you need to generate a new patch file.

To generate a new one, just repeat the steps you made to generate the first
one.

i.e. manually make the appropriate file changes, then run

patch-package @giphy/js-analytics

Info:
Patch file: patches/@giphy+js-analytics+4.0.7.patch
Patch was made for version: 4.0.7
Installed version: 4.1.1

ERROR Failed to apply patch for package @giphy/js-brand at path

node_modules/@giphy/js-brand

This error was caused because @giphy/js-brand has changed since you
made the patch file for it. This introduced conflicts with your patch,
just like a merge conflict in Git when separate incompatible changes are
made to the same piece of code.

Maybe this means your patch file is no longer necessary, in which case
hooray! Just delete it!

Otherwise, you need to generate a new patch file.

To generate a new one, just repeat the steps you made to generate the first
one.

i.e. manually make the appropriate file changes, then run

patch-package @giphy/js-brand

Info:
Patch file: patches/@giphy+js-brand+2.0.4.patch
Patch was made for version: 2.0.4
Installed version: 2.2.2


patch-package finished with 2 error(s).
npm notice
npm notice New minor version of npm available! 8.11.0 → 8.13.2
npm notice Changelog: Release v8.13.2 · npm/cli · GitHub
npm notice Run npm install -g npm@8.13.2 to update!
npm notice
npm ERR! code 1
npm ERR! path /usr/share/jitsi-meet
npm ERR! command failed
npm ERR! command sh -c patch-package --error-on-fail && jetify

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-07-06T09_49_01_983Z-debug-0.log

I can confirm that without “npm update” the build was successful without errors.

yea I see this is because I have removed the package-lock.json as this answer helps me

Why did you remove the file? Genuinely curious.