@Yury I am asking about node.js, rather than Node-RED.
Your original post says you have Node v16.16.0 - which is quite recent. So you must have installed/updated it more recently than two years ago.
A normal node.js install will include npm. For some reason it is not included for you.
What platform/os is this on? The instructions you've shared for installing Node-RED are not ones I recognise - they certainly haven't come from us. So is this a custom piece of hardware you are using? Or a particular OS that provides its own packages for node.js and node-red?
You are absolutely right, I updated to this version a month ago. Originally there was, of course, a younger version.
And until today, there was also npm. But after it was removed by the npm install -g email@example.com
and the system stopped seeing him.
In my case, today NodeRed is a NodeJS package, which itself is a package of system Entware. And this system is deployed on the Linux operating system, which runs on a home router.
Which, of course, is very convenient and, most importantly, reliable. For 4 years, I have never had any NodeRed failures, not counting those caused by my inexperience. I was among the first in the country who started working on such hardware.
Taking this opportunity, I would like to thank you from the bottom of my heart for your work in creating and developing such a wonderful programming environment.
It is cli.js not npm.js
To execute a file that is not in the path you have to address it directly, so from that folder it would be ./cli.js
But I don't think that file is supposed to be executed directly.
Sorry, I have no idea what is going on, possibly the npm you have installed is not compatible with the node.js that you have. The only suggestion that I have is to uninstall node.js and npm and then reinstall node.js, which should give you a working version of npm that is compatible with nodejs 16. Then don't try to upgrade npm to a later version.