Installation

Upgrade to 2.19: node problems

Upgrade to 2.19: node problems

by Alexei Kolesnikov -
Number of replies: 5

The webwork server I am upgrading is behind a proxy server. This was not a problem for additional Perl packages (I did have to provide username/password for the proxy server in CPAN shell), but I am stuck on

$ npm ci 

in webwork2/htdocs and pg/htdocs

I am using 

$ sudo npm --https-proxy https://proxy.server.name:443 ci

And I tried a version with username/password -- same results.

I think both log files point to the same issue. I put the error lines from the log files below. My question is whether there is a workaround: can I get the needed files some other way?

--Alexei


Part of the log file ("IP_addr" is some IP address):

verbose audit error FetchError: request to https://registry.npmjs.org/-/npm/v1/security/audits/quick failed, reason: connect ECONNREFUSED <IP_addr:443>

verbose audit error   errno: 'ECONNREFUSED',

verbose audit error   syscall: 'connect',

verbose audit error   address: 'IP_addr',

verbose audit error   port: 443,


In reply to Alexei Kolesnikov

Re: Upgrade to 2.19: node problems

by Glenn Rice -

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).

In reply to Glenn Rice

Re: Upgrade to 2.19: node problems

by Alexei Kolesnikov -
Thank you, Glen! Yes, I tried that solution from the link first: roughly the same result, but with an additional warning that the ability to communicate over http has been deprecated in 2021. So the command I tried is essentially in the same spirit, but trying to use https.

Same results without 'sudo'.
In reply to Alexei Kolesnikov

Re: Upgrade to 2.19: node problems

by Glenn Rice -
Yes, not using "sudo" won't fix your issue. My point was just that you should not be using "sudo" for this in any scenario.

The stack exchange post that I linked was quite old. Here is something newer: https://medium.com/@d_dhana/working-with-npm-behind-network-proxy-444ced82a3

Unfortunately, I can't really help you with this other than to point you to things I find on the internet. I don't have a proxy requiring authentication to work behind and test this.

You could try cloning the webwork2 and pg repositories on a computer that is not behind a proxy, then run "npm ci" there (you only need to have node and npm installed on that computer for this to work), and then copy all of the htdocs directories to your server.
In reply to Glenn Rice

Re: Upgrade to 2.19: node problems

by Alexei Kolesnikov -
Update: cloning webwork2 and pg on a computer not behind the proxy, running "npm ci" and then copying over (and changing permissions) worked! I used instructions from https://webwork.maa.org/wiki/Installation_Manual_for_2.19_on_Ubuntu#Set_File_and_Directory_Permissions

I opened a service request with our tech unit to figure out how to make it work long-term; will update when there are any outcomes. Thank you again!
In reply to Alexei Kolesnikov

Re: Upgrade to 2.19: node problems

by Alexei Kolesnikov -
Update:
deb.nodesource.com was added by the technology team as an allowed domain for the proxy server. The following command now succeeds:
$ npm --proxy http://[proxy server name]:80 ci