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
Create a Dockerfile and write the following content:
2. `docker build . -t test`
3. Error is as follows
`error An unexpected error occurred: "http://ip/npm/chalk/-/chalk-3.0.0.tgz: Request failed \"404 Not Found\"".`
### Environment
```shell
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.
Self-service
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.19To reproduce
RUN yarn config set registry http://ip:port/npm/
RUN yarn global add pm2
Additional context
No response