You would `npm install` and then `git commit`. That's why npm didn't have a lock file back then. Git was the lock file.
another rather simple solution is a git mirror of each package, then point npm to a git url