yo icon indicating copy to clipboard operation
yo copied to clipboard

ParseError when searching for NPM generators

Open jeffyoung opened this issue 7 years ago • 9 comments

Similar to #375, different error.

My environment

  • OS version/details: Windows 10 64-bit
  • Node version: 6.9.1
  • npm version: 3.10.8
  • Version of yo : 2.0.0

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

jeffyoung avatar Jun 14 '17 18:06 jeffyoung

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

foo-baar avatar Aug 16 '17 10:08 foo-baar

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

SBoudrias avatar Aug 16 '17 11:08 SBoudrias

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

Danke.

foo-baar avatar Aug 16 '17 16:08 foo-baar

Did anyone solve this issue? Facing the same problem.

WaqasIbrahim avatar Aug 25 '17 15:08 WaqasIbrahim

@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, 👍

foo-baar avatar Aug 26 '17 04:08 foo-baar

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.

SBoudrias avatar Aug 26 '17 07:08 SBoudrias

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.

WaqasIbrahim avatar Aug 26 '17 09:08 WaqasIbrahim

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

foo-baar avatar Aug 26 '17 09:08 foo-baar

@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 ;)

SBoudrias avatar Aug 26 '17 14:08 SBoudrias