Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error running licensed list #297

Closed
jamesgraham opened this issue Jul 30, 2020 · 2 comments · Fixed by #300
Closed

Parse error running licensed list #297

jamesgraham opened this issue Jul 30, 2020 · 2 comments · Fixed by #300

Comments

@jamesgraham
Copy link

Any ideas which file is causing this? I have validated package.json is valid json.

Listing dependencies for x
  npm
Traceback (most recent call last):
	34: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/bin/licensed:23:in `<main>'
	33: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/bin/licensed:23:in `load'
	32: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/exe/licensed:5:in `<top (required)>'
	31: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
	30: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
	29: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
	28: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
	27: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/cli.rb:35:in `list'
	26: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/cli.rb:99:in `run'
	25: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:22:in `run'
	24: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/reporters/reporter.rb:64:in `report_run'
	23: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:29:in `block in run'
	22: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:29:in `map'
	21: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:29:in `block (2 levels) in run'
	20: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:58:in `run_app'
	19: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/reporters/list_reporter.rb:13:in `report_app'
	18: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/reporters/reporter.rb:86:in `report_app'
	17: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/reporters/list_reporter.rb:15:in `block in report_app'
	16: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:59:in `block in run_app'
	15: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:59:in `chdir'
	14: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:68:in `block (2 levels) in run_app'
	13: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:68:in `map'
	12: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:68:in `block (3 levels) in run_app'
	11: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/list.rb:26:in `run_source'
	10: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:85:in `run_source'
	 9: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/reporters/list_reporter.rb:27:in `report_source'
	 8: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/reporters/reporter.rb:109:in `report_source'
	 7: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/reporters/list_reporter.rb:29:in `block in report_source'
	 6: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/commands/command.rb:92:in `block in run_source'
	 5: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/sources/source.rb:48:in `dependencies'
	 4: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/sources/source.rb:65:in `cached_dependencies'
	 3: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/sources/npm.rb:16:in `enumerate_dependencies'
	 2: from /__enclose_io_memfs__/lib/ruby/gems/2.6.0/gems/licensed-2.12.2/lib/licensed/sources/npm.rb:33:in `packages'
	 1: from /__enclose_io_memfs__/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/__enclose_io_memfs__/lib/ruby/2.6.0/json/common.rb:156:in `parse': 767: unexpected token at '' (JSON::ParserError)
@jonabc
Copy link
Contributor

jonabc commented Jul 30, 2020

@jamesgraham Usually that means that npm returned an error. Can you run npm list --json --production --long manually and see if it returns cleanly and without any errors? Either way licensed should protect against this crash, let's use this issue to track the fix.

If you have time to look at a fix and open a PR here's the relevant code. I'm pretty busy these days and won't be able to get to a fix quickly.

@jamesgraham
Copy link
Author

Thanks @jonabc I managed to find that code and figured NPM was returning an error. I'm running it in GitHub Actions and it was missing an NPM auth token in the env.

Unfortunately I'm not a ruby dev but I agree let's keep this open to track a potential sanity check fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants