Open jcollum opened 9 years ago
Works for me. You're probably just having connection problems.
❯ yo
? 'Allo Sindre! What would you like to do? Install a generator
? Search npm for generators: fast
? Here's what I found. Official generator → ෴
Install one? (Use arrow keys)
❯ andy A fast and intuitive Yeoman generator for Android with great attitude!
deslight A Yeoman generator for lightning fast web application development
fastgap Scaffold out a mobile phonegap app
gulp-ng-fast Yeoman generator for gulp+angular+coffee+less+jade
jumper A Yeoman generator «Jumper» for the fast scaffolding front-end web applications
simplesite Simple generator for fast creating static websites
spa-prototype A Yeoman generator for a faster single page application development
(Move up and down to reveal more choices)
Nope:
$ curl -L http://npmjs.org
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>npm</title>
<meta http-equiv="cleartype" content="on" />
<meta name="apple-mobile-web-app-capable" content="no">
<meta name="description" content="npm is the package manager for javascript">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,initial-scale=1,user-scalable=yes">
...
That's not the same. Different tool and different server.
Try again a few times and see if it's repeatable.
Are you behind a proxy or firewall of some kind?
I bet it's because we are using a pass-through NPM repo:
$ cat ~/.npmrc
registry=http://xxx.mycompany.com/xxx/api/npm/npm-repo
I don't know why that would break your tool but that seems like the most likely culprit.
@jcollum We don't spawn npm as the npm CLI search is just too slow. Instead we use package-json which talks directly to the npm server. It does support custom registries defined in .npmrc
.
Try console.log'ing what URL is being used here: https://github.com/sindresorhus/package-json/blob/6f9a9da97f26b2d3e536ddd853de092aff478c2e/index.js#L22 (in the dependency in the node_modules
folder inside yo
.
We are planning to switch from the npm search to our custom server to speed it up further: https://github.com/yeoman/yo/issues/361 That would solve your issue automagically. Someone needs to do it, though.
Happened again today. Here's the opts
object from /Users/collumj/.nvm/versions/node/v4.2.0/lib/node_modules/yo/node_modules/got/index.js:106:11
{ protocol: null,
path: '/blacklist.json',
retries: 5,
slashes: true,
auth: null,
host: 'yeoman.io',
port: null,
hostname: 'yeoman.io',
hash: null,
search: null,
query: null,
pathname: '/blacklist.json',
href: 'http://yeoman.io/blacklist.json',
json: true,
headers:
{ 'user-agent': 'https://github.com/sindresorhus/got',
'accept-encoding': 'gzip,deflate',
accept: 'application/json' },
method: 'GET' }
{ protocol: 'http:',
path: '/aaa/api/npm/npm-repo/-/_view/byKeyword?startkey=[%22yeoman-generator%22]&endkey=[%22yeoman-generator%22,%7B%7D]&group_level=3',
retries: 5,
slashes: true,
auth: null,
host: 'aaa.bbb.com',
port: null,
hostname: 'aaa.bbb.com',
hash: null,
search: '?startkey=[%22yeoman-generator%22]&endkey=[%22yeoman-generator%22,%7B%7D]&group_level=3',
pathname: '/aaa/api/npm/npm-repo/-/_view/byKeyword',
href: 'http://aaa.bbb.com/aaa/api/npm/npm-repo/-/_view/byKeyword?startkey=[%22yeoman-generator%22]&endkey=[%22yeoman-generator%22,%7B%7D]&group_level=3',
json: true,
headers:
{ 'user-agent': 'https://github.com/sindresorhus/got',
'accept-encoding': 'gzip,deflate',
accept: 'application/json' },
method: 'GET' }
Stack:
HTTPError: Response code 404 (Not Found)
at /Users/collumj/.nvm/versions/node/v4.2.0/lib/node_modules/yo/node_modules/got/index.js:106:11
at BufferStream.<anonymous> (/Users/collumj/.nvm/versions/node/v4.2.0/lib/node_modules/yo/node_modules/got/node_modules/read-all-stream/index.js:64:3)
at emitNone (events.js:72:20)
at BufferStream.emit (events.js:166:7)
at finishMaybe (/Users/collumj/.nvm/versions/node/v4.2.0/lib/node_modules/yo/node_modules/got/node_modules/read-all-stream/node_modules/readable-stream/lib/_stream_writable.js:509:14)
at endWritable (/Users/collumj/.nvm/versions/node/v4.2.0/lib/node_modules/yo/node_modules/got/node_modules/read-all-stream/node_modules/readable-stream/lib/_stream_writable.js:519:3)
at BufferStream.Writable.end (/Users/collumj/.nvm/versions/node/v4.2.0/lib/node_modules/yo/node_modules/got/node_modules/read-all-stream/node_modules/readable-stream/lib/_stream_writable.js:484:5)
at IncomingMessage.onend (_stream_readable.js:490:10)
at IncomingMessage.g (events.js:260:16)
at emitNone (events.js:72:20)
I tried console logging on the line you asked for but it isn't hitting that line. That aaa.bbb.com
is our local npm repo (changed the URL to hide our operations details). It seems very likely that our npm
repo doesn't support something that your app is relying on. I'm saying it's probably our fault.
I just tried to search for an angular generator and hit this error again. I had forgotten about it! Do you have any suggestions?
@eddiemonge is working on https://github.com/yeoman/yo/issues/361 which will fix your problem.
Never used yeoman before (on this machine/job anyway, I've used it at home). Installed it a few minutes ago. It crashed quickly:
versions:
Recreate: