Trace:
TypeError: Cannot use 'in' operator to search for 'latest' in undefined
at /Users/griffin.michl/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/lib/resolvers/registries/npm-resolver.js:62:24
at next (native)
at step (/Users/griffin.michl/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/griffin.michl/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at Promise.F (/Users/griffin.michl/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/core-js/library/modules/_export.js:35:28)
at /Users/griffin.michl/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
at Function.findVersionInRegistryResponse (/Users/griffin.michl/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/lib/resolvers/registries/npm-resolver.js:72:7)
at /Users/griffin.michl/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/lib/resolvers/registries/npm-resolver.js:89:34
at next (native)
at step (/Users/griffin.michl/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
Cannot install any new packages via yarn add. Always throws this error. No issues install existing dependencies.
This is because npmjs is down due to the DNS issues today, I believe. Still, yarn should catch this error and give a saner response.
I believe this might be the source: http://www.theregister.co.uk/2016/10/21/dns_dyn_ddos/?mt=1477070508444
I did look into it a bit.
The offending line is:
if (range in body['dist-tags']) {
range = body['dist-tags'][range];
}
However, body is:
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>DNS resolution error | registry.yarnpkg.com | CloudFlare</title></title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>
</head>
<body>
<div id="cf-wrapper">
<div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
<div id="cf-error-details" class="cf-error-details-wrapper">
<div class="cf-wrapper cf-header cf-error-overview">
<h1>
<span class="cf-error-type" data-translate="error">Error</span>
<span class="cf-error-code">1001</span>
<small class="heading-ray-id">Ray ID: 2f566e60397b051a • 2016-10-21 17:29:20 UTC</small>
</h1>
<h2 class="cf-subheadline" data-translate="error_desc">DNS resolution error</h2>
</div><!-- /.header -->
<section></section><!-- spacer -->
<div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2 data-translate="what_happened">What happened?</h2>
<p>You've requested a page on a website (registry.yarnpkg.com) that is on the <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing?utm_source=error_100x" target="_blank">CloudFlare</a> network. CloudFlare is currently unable to resolve your requested domain (registry.yarnpkg.com). There are two potential causes of this:</p>
<ul>
<li><strong>Most likely:</strong> if the owner just signed up for CloudFlare it can take a few minutes for the website's information to be distributed to our global network.</li>
<li><strong>Less likely:</strong> something is wrong with this site's configuration. Usually this happens when accounts have been signed up with a partner organization (e.g., a hosting provider) and the provider's DNS fails.</li>
</ul>
</div>
</div>
</div><!-- /.section -->
<div class="cf-error-footer cf-wrapper">
<p>
<span class="cf-footer-item">CloudFlare Ray ID: <strong>2f566e60397b051a</strong></span>
<span class="cf-footer-separator">•</span>
<span class="cf-footer-item"><span data-translate="your_ip">Your IP</span>: 64.180.112.143</span>
<span class="cf-footer-separator">•</span>
<span class="cf-footer-item"><span data-translate="performance_security_by">Performance & security by</span> <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">CloudFlare</a></span>
</p>
</div><!-- /.error-footer -->
</div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
<script type="text/javascript">
window._cf_translation = {};
</script>
</body>
</html>
Apparently that DDoS is over, but the registry is still down.
Still down?
Seems so
Is in possible to bypass the Yarn registry and have yarn retrieve packages directly from npmjs?
Until this is resolved I was able to use npm install to get the package.
I don't think this should be closed. Not being able to connect to the server should not result in a cryptic code-based error.
Agreed. Additionally, yarn should be able to connect directly to registry.npmjs.com so our yarn.lock files continue to work during registry.yarnpkg.com outages.
Agreed, if npm can install yarn should also be able too.
Based on this tweet connection to registry should be restored.
registry.yarnpkg.com is now bypassing DNS to registry.npmjs.org so this should no longer be a problem
There was also a good workaround posted in another related issue
@tuures:
# .npmrc registry = https://registry.npmjs.org/
@thejameskyle what happens if both are down?
@rivertam not sure what you mean
@thejameskyle I'm not sure what "bypassing DNS to registry.npmjs.org" means (I assume you mean the IP is hard-coded or something), but what happens if the entire system (npm, yarn, the whole shebang) is down?
I'm not sure what "bypassing DNS to registry.npmjs.org" means (I assume you mean the IP is hard-coded or something)
Yeah we moved from a CNAME to registry.npmjs.org to an A record with a hardcoded IP for now on registry.yarnpkg.com. It'll be slower for non-us users but we can switch back once Dyn has resolved their issues
but what happens if the entire system (npm, yarn, the whole shebang) is down?
Well if everything goes down there's not much we can do.
You can hopefully just use what you have in your cache or setup an offline mirror using the yarn-offline-mirror field. @bestander is working on a blog post for this.
Yeah what I mean is -- will this still result in a cryptic error or will it give a more meaningful error message? I don't mean to sound entitled as I'm clearly not contributing code yet, but this felt bad to see as an error when really it should have been something like "Can't connect to yarn/npm". That's all I'm saying. =)
Please do contribute back improvements to error messages, that is very useful
npmjs is down, too.
On Fri, Oct 21, 2016 at 11:08 AM spiffytech [email protected]
wrote:
Is in possible to bypass the Yarn registry and have yarn retrieve
packages directly from npmjs?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/yarnpkg/yarn/issues/1348#issuecomment-255435476, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAUAmUe3uMIPtNKYErifOev-d33j3k16ks5q2P-tgaJpZM4Kdbbr
.
Most helpful comment
Agreed, if
npmcan installyarnshould also be able too.