I recommend doing a Google search on how to use npm behind a proxy. I find https://stackoverflow.com/questions/7559648/is-there-a-way-to-make-npm-install-the-command-to-work-behind-proxy in a quick search which seems to be what you need.
I also not that you used "sudo" with the "npm ci" command. You certainly should not do that. You should own the files in /opt/webwork/webwork2 and /opt/webwork/pg (with group ownership set for the server user).