Rolling back node,js version

Trying to get downgrade of node version straight in my head and a way to prepare for the upgrade incase of issues.

Scenario: I upgrade node from 18 to 20 on a server running multiple sites, some are now broken and I need to roll back to 18.

Assuming I install and upgrade node by adding repository + apt. It would just be a case of: apt remove nodejs than add repo for node 18 and apt install nodejs.

Easy enough, but than do we run into issues with dependencies which were built on 20? I would think so.

So to prepare for that scenario before upgrading node.js does it make sense to make a copy node_modules which can be used in the case of a roll back on node and prevent a bunch of sites having to rebuild them?

Answered my own question :)