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

[Bug?]: The registry of Yarn is set using the IP address:port/npm. However, Yarn fails to obtain resources from the IP address:port/npm. #9053

Open
1 task
majestichou opened this issue Apr 15, 2024 · 0 comments
Labels

Comments

@majestichou
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

An npm image source exists and its address is http://ip:port/npm/. Run the following command to set the registry:
yarn config set registry http://ip:port/npm/ .
Then I installed pm2 with the following command:
yarn global add pm2
The installation fails. The following error information is displayed:
error An unexpected error occurred: "http://ip/npm/chalk/-/chalk-3.0.0.tgz: Request failed \"404 Not Found\"".
From the above error message, it can be seen that I have set the port, but the yarn does not take effect.
Yarn should not obtain resources from http://ip/npm/chalk/-/chalk-3.0.0.tgz. Instead, it should obtain resources from http://ip:port/npm/chalk/-/chalk-3.0.0.tgz. The port setting does not take effect.
Then I use Chrome to visit http://ip:port/npm/chalk/-/chalk-3.0.0.tgz address, normally downloaded the installation package.
This proves that there is no problem with the server, yarn has a bug.
My yarn version is 1.22.19

To reproduce

  1. Create a Dockerfile and write the following content:
FROM node:20.11-alpine3.19 AS base

RUN yarn config set registry http://ip:port/npm/

RUN yarn global add pm2
  1. docker build . -t test
  2. Error is as follows
    error An unexpected error occurred: "http://ip/npm/chalk/-/chalk-3.0.0.tgz: Request failed \"404 Not Found\"".

Environment

yarn dlx -q envinfo --preset jest
yarn run v1.22.19
error Command "dlx" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional context

No response

@arcanis arcanis transferred this issue from yarnpkg/berry Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant