yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.39k stars 2.73k forks source link

yarn make requests to yarnpkg server after setting registry to a private one #7243

Open P0oOOOo0YA opened 5 years ago

P0oOOOo0YA commented 5 years ago

I have installed verdaccio and published a private pacakge to it and have set yarn registry to make requests to verdaccio proxy server. yarn makes request to the proxy server with some following requests to yarnpkg server which is not the expected behavior after setting the registry to a private one. When a user sets the registry he simple means hey yarn don't do any other requests in anyway to any server other than what i have set explicitly for you. All your requests should be targeted towards what i have set for you.

$ yarn config get registry
http://localhost:4873/
$ yarn add @electron-e/store --verbose
yarn add v1.15.2
warning You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.
verbose 0.66 Checking for configuration file "/home/devilfromir/Code/projects/desktop/NRobo/.npmrc".
verbose 0.661 Checking for configuration file "/home/devilfromir/.npmrc".
verbose 0.661 Checking for configuration file "/usr/etc/npmrc".
verbose 0.662 Checking for configuration file "/home/devilfromir/Code/projects/desktop/NRobo/.npmrc".
verbose 0.662 Checking for configuration file "/home/devilfromir/Code/projects/desktop/.npmrc".
verbose 0.662 Checking for configuration file "/home/devilfromir/Code/projects/.npmrc".
verbose 0.662 Checking for configuration file "/home/devilfromir/Code/.npmrc".
verbose 0.663 Checking for configuration file "/home/devilfromir/.npmrc".
verbose 0.663 Checking for configuration file "/home/.npmrc".
verbose 0.665 Checking for configuration file "/home/devilfromir/Code/projects/desktop/NRobo/.yarnrc".
verbose 0.665 Checking for configuration file "/home/devilfromir/.yarnrc".
verbose 0.665 Found configuration file "/home/devilfromir/.yarnrc".
verbose 0.666 Checking for configuration file "/usr/etc/yarnrc".
verbose 0.666 Checking for configuration file "/home/devilfromir/Code/projects/desktop/NRobo/.yarnrc".
verbose 0.666 Checking for configuration file "/home/devilfromir/Code/projects/desktop/.yarnrc".
verbose 0.666 Checking for configuration file "/home/devilfromir/Code/projects/.yarnrc".
verbose 0.666 Checking for configuration file "/home/devilfromir/Code/.yarnrc".
verbose 0.666 Checking for configuration file "/home/devilfromir/.yarnrc".
verbose 0.667 Found configuration file "/home/devilfromir/.yarnrc".
verbose 0.667 Checking for configuration file "/home/.yarnrc".
verbose 0.671 current time: 2019-05-02T04:07:57.340Z
[1/4] Resolving packages...
verbose 1.101 Performing "GET" request to "http://localhost:4873/@electron-e%2fstore".
verbose 1.168 Request "http://localhost:4873/@electron-e%2fstore" finished with status code 200.
[2/4] Fetching packages...
verbose 1.259 Performing "GET" request to "https://registry.yarnpkg.com/antd/-/antd-3.16.6.tgz".
verbose 1.279 Performing "GET" request to "https://registry.yarnpkg.com/array-tree-filter/-/array-tree-filter-2.1.0.tgz".
verbose 1.281 Performing "GET" request to "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 1.292 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/create-react-context/-/create-react-context-0.2.4.tgz".
verbose 1.295 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons/-/icons-1.2.1.tgz".
verbose 1.297 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons-react/-/icons-react-1.1.5.tgz".
verbose 1.299 Performing "GET" request to "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz".
verbose 1.303 Performing "GET" request to "https://registry.yarnpkg.com/@types/react-slick/-/react-slick-0.23.3.tgz".
verbose 4.293 Performing "GET" request to "https://registry.yarnpkg.com/antd/-/antd-3.16.6.tgz".
verbose 4.296 Performing "GET" request to "https://registry.yarnpkg.com/array-tree-filter/-/array-tree-filter-2.1.0.tgz".
verbose 4.299 Performing "GET" request to "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz".
verbose 4.301 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/create-react-context/-/create-react-context-0.2.4.tgz".
verbose 4.304 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons/-/icons-1.2.1.tgz".
verbose 4.307 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons-react/-/icons-react-1.1.5.tgz".
verbose 4.31 Performing "GET" request to "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz".
verbose 4.312 Performing "GET" request to "https://registry.yarnpkg.com/@types/react-slick/-/react-slick-0.23.3.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 7.334 Performing "GET" request to "https://registry.yarnpkg.com/antd/-/antd-3.16.6.tgz".
verbose 7.337 Performing "GET" request to "https://registry.yarnpkg.com/array-tree-filter/-/array-tree-filter-2.1.0.tgz".
verbose 7.34 Performing "GET" request to "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz".
verbose 7.343 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/create-react-context/-/create-react-context-0.2.4.tgz".
verbose 7.345 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons/-/icons-1.2.1.tgz".
verbose 7.348 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons-react/-/icons-react-1.1.5.tgz".
verbose 7.35 Performing "GET" request to "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz".
verbose 7.353 Performing "GET" request to "https://registry.yarnpkg.com/@types/react-slick/-/react-slick-0.23.3.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 10.382 Performing "GET" request to "https://registry.yarnpkg.com/antd/-/antd-3.16.6.tgz".
verbose 10.386 Performing "GET" request to "https://registry.yarnpkg.com/array-tree-filter/-/array-tree-filter-2.1.0.tgz".
verbose 10.387 Performing "GET" request to "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz".
verbose 10.388 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/create-react-context/-/create-react-context-0.2.4.tgz".
verbose 10.389 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons/-/icons-1.2.1.tgz".
verbose 10.39 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons-react/-/icons-react-1.1.5.tgz".
verbose 10.39 Performing "GET" request to "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz".
verbose 10.391 Performing "GET" request to "https://registry.yarnpkg.com/@types/react-slick/-/react-slick-0.23.3.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 13.4 Performing "GET" request to "https://registry.yarnpkg.com/antd/-/antd-3.16.6.tgz".
verbose 13.404 Performing "GET" request to "https://registry.yarnpkg.com/array-tree-filter/-/array-tree-filter-2.1.0.tgz".
verbose 13.405 Performing "GET" request to "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz".
verbose 13.406 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/create-react-context/-/create-react-context-0.2.4.tgz".
verbose 13.407 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons/-/icons-1.2.1.tgz".
verbose 13.408 Performing "GET" request to "https://registry.yarnpkg.com/@ant-design/icons-react/-/icons-react-1.1.5.tgz".
verbose 13.408 Performing "GET" request to "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz".
verbose 13.409 Performing "GET" request to "https://registry.yarnpkg.com/@types/react-slick/-/react-slick-0.23.3.tgz".
verbose 13.423 Error: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
error An unexpected error occurred: "https://registry.yarnpkg.com/antd/-/antd-3.16.6.tgz: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".
info If you think this is a bug, please open a bug report with the information provided in "/home/devilfromir/Code/projects/desktop/NRobo/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
$ yarn config list
yarn config v1.15.2
info yarn config
{ 'version-tag-prefix':
   'v',
  'version-git-tag':
   true,
  'version-commit-hooks':
   true,
  'version-git-sign':
   false,
  'version-git-message':
   'v%s',
  'init-version':
   '1.0.0',
  'init-license':
   'MIT',
  'save-prefix':
   '^',
  'bin-links':
   true,
  'ignore-scripts':
   false,
  'ignore-optional':
   false,
  registry:
   'http://localhost:4873/',
  'strict-ssl':
   true,
  'user-agent':
   'yarn/1.15.2 npm/? node/v10.15.2 linux x64',
  'cache-folder':
   '/tmp',
  lastUpdateCheck:
   1556742143802 }
info npm config
{}
Done in 0.03s.
Susy123 commented 5 years ago

troubles me too. This problem prevents yarn from being available on the Intranet server. Will appreciate a lot if someone has solutions.

jeppy commented 4 years ago

you can try add '--offline' option yarn add @electron-e/store --verbose --offline

JaosnHsieh commented 2 years ago

I'm having similar issues on macos v11.3.1 but works well on v11.2.3.

I'm trying to use local private npm on the macos host network, there is a private npm service (verdaccio) ruuning on http://host.docker.internal:4873.

docker run --rm -it node:16.13.2-alpine3.14 sh

mkdir test

cd test

yarn add express --verbose

on macos v11.3.1, the fetching url is different between. [1/4] Resolving packages... and [2/4] Fetching packages... steps.

It ended up with an error error An unexpected error occurred: "http://localhost:4873/array-flatten/-/array-flatten-1.1.1.tgz: connect ECONNREFUSED 127.0.0.1:4873".

...
[1/4] Resolving packages...
verbose 0.474608063 Performing "GET" request to "http://host.docker.internal:4873/express".
...
...
[2/4] Fetching packages...
verbose 2.001301312 Performing "GET" request to "http://localhost:4873/accepts/-/accepts-1.3.8.tgz".
...

on macos v11.2.3, it works well.

PeterChen401 commented 12 months ago

troubles me too. This behavior is really stupid.