Node predates npm. All node does is look for dependencies in the nearest node_modules directory. (And all npm does is download dependencies into that folder). So you can simply archive / check in your node_modules directory if you want to. I think there’s tools to help out and make sure the dependency versions are all pinned. (npm shrink-wrap and friends)
But languages like go and rust have had the ability to “vendor dependencies” for awhile now.
Don’t need an active internet connection. Just need to have the toolchain.