yeoman / yo

CLI tool for running Yeoman generators
http://yeoman.io
BSD 2-Clause "Simplified" License
3.83k stars 398 forks source link

ParseError when doing a search #540

Closed vitalkanev closed 6 years ago

vitalkanev commented 6 years ago
? 'Allo [object Object]! What would you like to do? Install a generator
? Search npm for generators: awesome list

     _-----_     ╭───────────────────────╮
    |       |    │      Bye from us!     │
    |--(o)--|    │       Chat soon.      │
   `---------´   │      Yeoman team      │
    ( _´U`_ )    │    http://yeoman.io   │
    /___A___\   /╰───────────────────────╯
     |  ~  |     
   __'.___.'__   
 ´   `  |° ´ Y ` 

ParseError
    at /usr/lib/node_modules/yo/node_modules/npm-keyword/node_modules/got/index.js:120:14
    at BufferStream.<anonymous> (/usr/lib/node_modules/yo/node_modules/read-all-stream/index.js:64:3)
    at emitNone (events.js:110:20)
    at BufferStream.emit (events.js:207:7)
    at finishMaybe (/usr/lib/node_modules/yo/node_modules/readable-stream/lib/_stream_writable.js:607:14)
    at afterWrite (/usr/lib/node_modules/yo/node_modules/readable-stream/lib/_stream_writable.js:470:3)
    at _combinedTickCallback (internal/process/next_tick.js:144:20)
    at process._tickCallback (internal/process/next_tick.js:180:9)

% yo --version
2.0.0 # from NPM

% uname -a
Linux {COMPUTER-NAME} 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux # Xubuntu Zesty

% node --version && npm --version
v8.5.0
5.3.0

I did replace my name to [object Object], becuase my name written in Russian

mischah commented 6 years ago

Can’t reproduce with this username with Mac OS 10.12.6:

шуталы Phillipow

So it might be a linux specific issue with https://github.com/sindresorhus/fullname which is used to get the name.

Going file an issue over there. But we should do a type check over here to prevent a parse error.

sindresorhus commented 6 years ago

@vitalkanev Can you add console.log(name); here: https://github.com/yeoman/yo/blob/b758791f3996376cfce697132de3eb3ad8e4bb51/lib/routes/home.js#L57 And let us know what it outputs?