npm init egg 报错【已解】
use registry: https://registry.npmjs.org
Got error when check update: Unexpected token < in JSON at position 0 (data json format: "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n<head>\n<title>Attention Required! | Cloudflare</title>\n<meta name=\"captcha-bypass\" id=\"captcha-bypass\" />\n<meta charset=\"UTF-8\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"" ...skip... "our IP</span>: 116.6.234.242</span>\n <span class=\"cf-footer-separator sm:hidden\">•</span>\n <span class=\"cf-footer-item sm:block sm:mb-1\"><span>Performance & security by</span> <a href=\"https://www.cloudflare.com/5xx-error-landing\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n \n </p>\n</div><!-- /.error-footer -->\n\n\n </div><!-- /#cf-error-details -->\n </div><!-- /#cf-wrapper -->\n\n <script type=\"text/javascript\">\n window._cf_translation = {};\n \n \n</script>\n\n\n</body>\n</html>\n"), GET https://registry.npmjs.org/egg-init/latest 403 (connected: true, keepalive socket: false, socketHandledRequests: 1, socketHandledResponses: 1)
headers: {"date":"Wed, 23 Sep 2020 07:15:29 GMT","content-type":"text/html; charset=UTF-8","transfer-encoding":"chunked","connection":"close","set-cookie":["__cfduid=db28f38d1fcb1d8e5e8e1c474d678df2c1600845329; expires=Fri, 23-Oct-20 07:15:29 GMT; path=/; domain=.npmjs.org; HttpOnly; SameSite=Lax"],"cf-ray":"5d72798c3f6723e0-HKG","cache-control":"private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0","vary":"Accept-Encoding","cf-chl-bypass":"1","cf-request-id":"055b6a4ba7000023e025289200000001","expect-ct":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"","x-frame-options":"SAMEORIGIN","server":"cloudflare"}
npm cache clean --force 重置源也不行
2 回复
你是不是用代理了?
‘Attention Required! | Cloudflare’ 或者,你的网段被限制了?需要输入验证码才能继续访问
老哥 谢谢,可以啦应该是网段被限制了,我开手机热点就可以啦