yeoman / yo

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

ParseError when searching for NPM generators #525

Open jeffyoung opened 7 years ago

jeffyoung commented 7 years ago

Similar to #375, different error.

My environment

yo --version && echo %PATH% %NODE_PATH% && node -e "console.log(process.platform, process.versions)" && type Gruntfile.js 2.0.0 C:\Users\jeyou\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\jeyou.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files (x86)\Git\cmd;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\SlikSvn\bin;C:\Program Files\TortoiseSVN\bin;C:\Users\jeyou\AppData\Local\Microsoft\WindowsApps;C:\Users\jeyou\AppData\Roaming\npm;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files (x86)\Microsoft VS Code Insiders\bin;C:\Program Files\Git\usr\bin; %NODE_PATH% win32 { http_parser: '2.7.0', node: '6.9.1', v8: '5.1.281.84', uv: '1.9.1', zlib: '1.2.8', ares: '1.10.1-DEV', icu: '57.1', modules: '48', openssl: '1.0.2j' } The system cannot find the file specified.

Expected behavior

I expect that I can search for generators.

Current behavior

Searching for any generator (vscode-typescript in my case) causes a ParseError. Not sure what's going sideways.

Steps to reproduce the behavior

npm install -g yo yo 'Search npm for generators:', provide 'vscode-typescript' CLI hangs for a while, then...

Command line output

image

Same url in Chrome: image

Yeoman Doctor: image

foo-baar commented 7 years ago

Hi, Facing the same issue, stats are the same as above.

SBoudrias commented 7 years ago

Looks like somehow you're receiving a xml file instead of json... I wonder if it's an issue with the npm API?

foo-baar commented 7 years ago

@SBoudrias Any way to fix this from my end ? NPM API is working fine for all other uses hence I would doubt that.

Danke.

WaqasIbrahim commented 7 years ago

Did anyone solve this issue? Facing the same problem.

foo-baar commented 7 years ago

@WaqasIbrahim The best way is to manually delete the package and remove entry from npm package.json and then if you need reinstall it.

However I have found most of the generators faulty & outdated, and found the team quit unresponsive when highlighted it to them.

You would rather wanna pull it directly from the package sites, perhaps quick start\hello world apps.

Good Luck, 👍

SBoudrias commented 7 years ago

However I have found most of the generators faulty & outdated

Yeah a lot of generators aren't being maintained. But you need to understand that with > 6000 generators and > 4 years since the initial Yeoman release, a lot of community members came and left. I believe you see the same thing in any developer ecosystem. The important is to properly search and select tools/generators that are being maintained (also true our search doesn't do an amazing job at surfacing them). You can rely on community projects like https://npms.io/ to get a better feel of the health of a generator or any Node.js project.

found the team quit unresponsive when highlighted it to them

Same as before, if a generator doesn't have active maintainers, then yeah you shouldn't expect an answer. People put free projects out there, without promises, it's really up to you to take time to figure out which one are maintained/reliable and ultimately works out for you. No magic involved here.

WaqasIbrahim commented 7 years ago

Thanks @foo-baar and @SBoudrias, I was looking for ghost theme generator but most used one was update a year ago. I might try to write a generator myself.

foo-baar commented 7 years ago

Dude @SBoudrias I have complete sympathy with you on this, no hard feeling ✌️

SBoudrias commented 7 years ago

@foo-baar BTW I didn't though you had hard feelings. I don't know what's your background (and from other people coming around this issue), so I just wanted to say the maintenance problem is inherent to most open source community. So vetting the tools we use is quite the useful skill to work on.

Again, for Node, https://npms.io has been my personal savior ;)