Since you clearly have npm and this is happening in a directory with a package.json, I recommend familiarizing yourself with npm-run-all(run-s, run-p), or equivalent, then you won't be tied to bash (can run on windows without bash installed, for example).
Also, there's pretty much no reason any of these commands should require sudo, and especially the npm ones are wildly unsafe. update can run arbitrary installation lifecycle scripts from unknown parties, and run well... runs the actual code of the dependencies in accordance with how your scripts call it. If this doesn't work without sudo in your case, you should probably fix the file permissions instead of giving superuser access to these already insecure tools.
Finally, you said "every time when I pull from the repository". These is a small chance you might be interested in git hooks, eg through git-hooks-js or husky
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
Since you clearly have
npmand this is happening in a directory with apackage.json, I recommend familiarizing yourself with npm-run-all(run-s,run-p), or equivalent, then you won't be tied to bash (can run on windows without bash installed, for example).Also, there's pretty much no reason any of these commands should require
sudo, and especially thenpmones are wildly unsafe.updatecan run arbitrary installation lifecycle scripts from unknown parties, andrunwell... runs the actual code of the dependencies in accordance with how your scripts call it. If this doesn't work withoutsudoin your case, you should probably fix the file permissions instead of giving superuser access to these already insecure tools.Finally, you said "every time when I pull from the repository". These is a small chance you might be interested in git hooks, eg through git-hooks-js or husky
Thanks Mihail Malo
when I run
npm updateI got this error :`
Wow, what an amazing error!
Good job, npm developers!
It tells you WHY this happened, and also tells you the correct way to fix it!
It's also very unlikely you want to run
git pullevery time you pull, because that would never end...lmao