Skip to content

[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
@majestichou

Description

@majestichou

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions