Nodered service is not starting on Ubuntu 20.04

Dear all,
From this morning on, I am not able to login to Node-red ui. I was getting just blank page. I rebooted the service, but is not starting. Output of log is following:

$ sudo systemctl status nodered
● nodered.service - Node-RED graphical event wiring tool
   Loaded: loaded (/lib/systemd/system/nodered.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2024-05-21 09:55:48 UTC; 12s ago
     Docs: http://nodered.org/docs/hardware/raspberrypi.html
  Process: 2278 ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS (code=exited, status=127)
 Main PID: 2278 (code=exited, status=127)

May 21 09:55:48 NodeRed systemd[1]: nodered.service: Scheduled restart job, restart counter is at 225.
May 21 09:55:48 NodeRed systemd[1]: Stopped Node-RED graphical event wiring tool.
May 21 09:55:48 NodeRed systemd[1]: Started Node-RED graphical event wiring tool.
May 21 09:55:48 NodeRed systemd[1]: nodered.service: Main process exited, code=exited, status=127/n/a
May 21 09:55:48 NodeRed system[1]: nodered.service: Failed with result 'exit-code'.

Any idea what might be wrong and how to solve it?

Was this running until then?
What did you do (if anything) to cause the problem.

What does
node -v
show?

Try running the install script and see what happens. If it fails then post the install log here (/var/log/nodered-install.log).

I solved it. The problem was in the damages npm. Once I reinstalled NPM, I needed to reinstall node-red as well, but all the settings and nodes stayed untached. So everything's fine.