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

Error when installing from a private registry #1840

Closed
yume-chan opened this issue May 20, 2019 · 2 comments · Fixed by #1841
Closed

Error when installing from a private registry #1840

yume-chan opened this issue May 20, 2019 · 2 comments · Fixed by #1841
Assignees
Milestone

Comments

@yume-chan
Copy link

pnpm version:

3.3.4

Code to reproduce the issue:

This happens when I run pnpm recursive install.

Unfortunately this problem happens when installing from our company's private registry, so I can't attach the log file, but I will include as much details as I know below.

Expected behavior:

Install successfully.

Actual behavior:

TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
    at new ClientRequest (_http_client.js:142:11)
    at request (http.js:44:10)
    at path\to\pnpm\lib\node_modules\node-fetch-unix\lib\index.js:1422:15
    at new Promise (<anonymous>)
    at fetch (path\to\pnpm\lib\node_modules\node-fetch-unix\lib\index.js:1391:9)
    at path\to\pnpm\lib\node_modules\@zeit\fetch-retry\index.js:38:27
    at RetryOperation.runAttempt [as _fn] (path\to\pnpm\lib\node_modules\async-retry\lib\index.js:35:15)
    at Timeout._onTimeout (path\to\pnpm\lib\node_modules\retry\lib\retry_operation.js:81:10)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
    at new ClientRequest (_http_client.js:142:11)
    at request (http.js:44:10)
    at path\to\pnpm\lib\node_modules\node-fetch-unix\lib\index.js:1422:15
    at new Promise (<anonymous>)
    at fetch (path\to\pnpm\lib\node_modules\node-fetch-unix\lib\index.js:1391:9)
    at path\to\pnpm\lib\node_modules\@zeit\fetch-retry\index.js:38:27
    at RetryOperation.runAttempt [as _fn] (path\to\pnpm\lib\node_modules\async-retry\lib\index.js:35:15)
    at Timeout._onTimeout (path\to\pnpm\lib\node_modules\retry\lib\retry_operation.js:81:10)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)

Additional information:

I can see pnpm tried to download the tgz from an https url, but got somehow redirected to an http url. As pnpm specifies custom agent for requests, it may uses wrong agent for the redirected request.

  • node -v prints: v12.2.0
  • Windows, OS X, or Linux?: Windows 10 1809 x64
@zkochan
Copy link
Member

zkochan commented May 20, 2019

This is probably a regression. We used to use make-fetch-happen in v2 but we switched to the better maintained node-fetch library instead. I added a test to cover this case, so it won't regress anymore.

@zkochan
Copy link
Member

zkochan commented May 21, 2019

🚢 3.4.0

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.

2 participants