node-gyp icon indicating copy to clipboard operation
node-gyp copied to clipboard

unable to verify the first certificate

Open CedricChing opened this issue 1 year ago • 3 comments

When I tried to execute ’npm install‘ command to download the dependencies, the error from node-gyp occurred. 'gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v20.11.1/node-v20.11.1-headers.tar.gz failed, reason: unable to verify the first certificate'

Here's the version node v20.11.1 npm v10.2.4 node-gyp v10.0.1 image

it's an urgent issue for me, looking forward to your reply. : )

CedricChing avatar Mar 02 '24 12:03 CedricChing

Hello! For me, it helped to disable and re-enable this property - npm config set strict-ssl false => npm config set strict-ssl true

PaulWeb30 avatar Apr 18 '24 18:04 PaulWeb30

The solution from @PaulWeb30 as strange it seems works for me as well.

michael-zerna avatar Apr 19 '24 07:04 michael-zerna

Hello! For me, it helped to disable and re-enable this property - npm config set strict-ssl false => npm config set strict-ssl true

It didn't work for me. However, I've found another way to avoid this problem. You can download the node-headers.tar.gz from browser, and then set a new key-value pair in the .npmrc file. For Linux, 'tarball = /path/to/node-headers' can be added to the .npmrc file. For windows, setting 'nodedir = /path/to/node-headers' works.

CedricChing avatar Jun 28 '24 07:06 CedricChing