Why don't you want to fork it? If you do that, edit package.json and then in your .node-red folder run npm install yourgitid/node-red-contrib-alexa-remote2
and restart node red you are all done.
The alternative without forking is to clone the repository to the node red server machine, edit package.json and then, from .node-red folder npm install path/to/clone/node-red-contrib-alexa-remote2
The advantage of a fork is that it will stay there and you don't need to remember to do it again if you have to rebuild your system.
About the first solution: will the npm install of my fork overwrite the original installation and if so, what about updates? And how did I go back to the original version, if the owner make the required update of dependency for his project?
Sorry for this questions, I only use the Palette Manager right now. And my installation is in a docker if this info helpful.
If I do the remove command, will node-red delete the nodes and the config? Or should I do all the commands while node-red is stopped? But in Docker I can only stop node-red by stopping the container and then a can‘t attached to the shell in the container to run npm.
Or is the remove/install not a problem with a running node-red instance?
It is not a problem to run npm while node-red is running. npm manipulates the files in your .node-red/node_modules folder, and package.json and package-lock.json. All of those are read when node-red is started and the nodes in node_modules are loaded, but are not referenced again, unless you use the package manager, which runs npm behind the scenes. So provided you do not run the package manager at the same time as running npm in a terminal then you should not have a problem. I do it all the time.
[Edit] Also the fact that you have temporarily removed the node will not affect your flows, they are in your flows file which npm does not touch.