Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm install throw Error UNABLE_TO_VERIFY_LEAF_SIGNATURE, but npm install is ok #4689

Closed
Beace opened this issue May 6, 2022 · 14 comments · Fixed by #6101
Closed

pnpm install throw Error UNABLE_TO_VERIFY_LEAF_SIGNATURE, but npm install is ok #4689

Beace opened this issue May 6, 2022 · 14 comments · Fixed by #6101
Assignees
Milestone

Comments

@Beace
Copy link

Beace commented May 6, 2022

pnpm version:

6.31.0

Code to reproduce the issue:

$ export https_proxy=http://127.0.0.1:9090 // I used proxyman to catch http(s) request
$ npm config set strict-ssl false

package.json

{
  "name": "test-pnpm",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@babel/traverse": "7.17.10"
  }
}

run npm install is fine, but pnpm install --registry=https://registry.npmjs.org throw Error

$ pnpm install --registry=http://registry.npmjs.org
WARN  GET https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.10.tgz error (UNABLE_TO_VERIFY_LEAF_SIGNATURE). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@babel%2Fcode-frame error (UNABLE_TO_VERIFY_LEAF_SIGNATURE). Will retry in 10 seconds. 2 retries left.

Expected behavior:

install success.

Actual behavior:

install failed.there is a screenshot.

origin_img_v2_4407e959-4dd7-4a1c-b075-5bc244128e1g

Additional information:

  • node -v prints: v16.0.0
  • macOS
@lvjiaxuan
Copy link

+1

@ghost
Copy link

ghost commented Nov 10, 2022

I'm facing the same issue, any news on the subject ?

@toxsick
Copy link

toxsick commented Dec 15, 2022

Having the same issue when installing a package from a private gitlab registry (cert should be ok though)

@ayblanchet
Copy link

Having the same issue, It's work with npm but not with pnpm.
I have no certificate and strict-ssl to false. Is there a workaround?

@Alsan
Copy link

Alsan commented Feb 16, 2023

same issue.

platform: linux
node: v16.19.0
pnpm: 7.27.0

@zkochan
Copy link
Member

zkochan commented Feb 17, 2023

try to run:

NODE_TLS_REJECT_UNAUTHORIZED=0 pnpm install

@zkochan
Copy link
Member

zkochan commented Feb 17, 2023

@zkochan
Copy link
Member

zkochan commented Feb 18, 2023

Try 7.27.1

@Alsan
Copy link

Alsan commented Feb 19, 2023

Almost done, but not for external binaries.

2023-02-19_11-04

@zkochan
Copy link
Member

zkochan commented Feb 19, 2023

but this error happens in a script. I don't think we have control over how the scripts fetch. Does it work with npm or yarn?

@Alsan
Copy link

Alsan commented Feb 19, 2023

yes, both npm and yarn works as expected.

@zkochan
Copy link
Member

zkochan commented Feb 19, 2023

I am not sure what is the issue. I see the warning in the output about NODE_TLS_REJECT_UNAUTHORIZED set to 0 and I see this: https://github.com/npm/minipass-fetch/blob/813e6d77e6b2279d650309dd8d8325bba229a38a/lib/request.js#L87

@Alsan
Copy link

Alsan commented Feb 19, 2023

I've add this env setting when running the pnpm install command as @zkochan said. I'll try to remove this flag to see will it help later today.

@Alsan
Copy link

Alsan commented Feb 20, 2023

checked, and tried to export proxy settings as environment before run pnpm install, didn't help.

export http_proxy=http://127.0.0.1:4000
export https_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
pnpm install --loglevel verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants