unable to verify the first certificate when running npm install

I was able to resolve the issue by using the instructions here: https://github.com/typings/typings/issues/564

The issue is ultimately related to my machine being behind some corporate proxy which seems to be related to npm unable to authenticate https against the proxy. Since I didn't have any further information about the proxy being used so was unable to configure as per @leetibbett suggestion above. So I created .typingsrc file in the root directory to use http version:

{
     "rejectUnauthorized": false,
     "registryURL": "http://api.typings.org/"
}

In my case adding the ca-file in .npmrc to the corporate proxy certificate was the solution:

npm config set cafile "path to proxy cert file"

or insert with editor in .npmrc:

cafile=<path to proxy cert file>

The .npmrc file is located in the home directory.


You can try change the registry to the http version in config

npm config set registry http://registry.npmjs.org/ --global