-
Notifications
You must be signed in to change notification settings - Fork 124
npm installer fails on proxy and certificates #228
Description
When I attempt to use the npm installer for Elm (on CentOS7):
npm install -g elm
(as per https://www.npmjs.com/package/elm)
I get the following error:
> > [email protected] install /home/dev/.nvm/versions/node/v6.11.3/lib/node_modules/elm
> > node install.js
>
> Error communicating with URL https://dl.bintray.com/elmlang/elm-platform/0.18.0/linux-x64.tar.gz Error: unable to get local issuer certificate
> npm ERR! Linux 3.10.0-693.17.1.el7.x86_64
> npm ERR! argv "/home/dev/.nvm/versions/node/v6.11.3/bin/node" "/home/dev/.nvm/versions/node/v6.11.3/bin/npm" "install" "-g" "elm"
> npm ERR! node v6.11.3
> npm ERR! npm v3.10.10
> npm ERR! code ELIFECYCLE
>
> npm ERR! [email protected] install: `node install.js`
> npm ERR! Exit status 1
> npm ERR!
> npm ERR! Failed at the [email protected] install script 'node install.js'.
> npm ERR! Make sure you have the latest version of node.js and npm installed.
> npm ERR! If you do, this is most likely a problem with the elm package,
> npm ERR! not with npm itself.
> npm ERR! Tell the author that this fails on your system:
> npm ERR! node install.js
> npm ERR! You can get information on how to open an issue for this project with:
> npm ERR! npm bugs elm
> npm ERR! Or if that isn't available, you can get their info via:
> npm ERR! npm owner ls elm
> npm ERR! There is likely additional logging output above.
>
> npm ERR! Please include the following file with any support request:
> npm ERR! /home/dev/projects/assessment-service/npm-debug.log
I have attached the npm-debug-log file:
npm-debug.log
One of my colleagues suggested this workaround:
wget https://dl.bintray.com/elmlang/elm-platform/0.18.0/linux-x64.tar.gz
sudo tar -zvxf linux-x64.tar.gz --strip-components=1 -C /usr/local/bin
and that was successful. He had a look at the issue and suggest that cause might be this:
We configure NPM to use a root certificate of the proxy
The ELM install script downloads a file from the internet but does not pass proxy configuration OR certificate configuration from NPM
So I think it is a bug in the ELM package install.js - specifically this:
https://github.com/elm-lang/elm-platform/blob/master/installers/npm/install.js#L27
My colleague believes the workaround is successful because wget will honor the https_proxy / HTTPS_PROXY environment variable