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

npm UNLICENSED package reported as The Unlicense license #324

Open
jamesbebbington opened this issue Oct 3, 2024 · 0 comments
Open

npm UNLICENSED package reported as The Unlicense license #324

jamesbebbington opened this issue Oct 3, 2024 · 0 comments

Comments

@jamesbebbington
Copy link

jamesbebbington commented Oct 3, 2024

We have a private Rails app with a package.json that starts:

{
  "name": "my-app",
  "type": "module",
  "license": "UNLICENSED",
  "dependencies": {

As my-app is a private package that we do not wish to publish or license for others to use, we have followed the npm guidance and specified it as UNLICENSED:

…if you do not wish to grant others the right to use a private or unpublished package under any terms:

{
  "license": "UNLICENSED"
}

However license_scout returns:

+--------+-----------------------------------------------+--------------------------------+-------------+
| Type   | Dependency                                    | License(s)                     | Results     |
+--------+-----------------------------------------------+--------------------------------+-------------+
| nodejs | my-app ()                                     | Unlicense                      | Not Allowed |

This maybe a misunderstanding on my part, but, confusingly The Unlicense (Short identifier Unlicense) is an actual SPDX-recognised software license.

I note that license_scout is meant to support UNLICENSED packages, but either something is not quite working right, or I don't understand how it's supposed to behave.

I have attempted to resolve this by adding an exclusion, to make the 'Not Allowed` result go away:

exceptions:
  nodejs:
    - name: my-app
      reason: This is a reference to the main application package itself

however that just results in this error:

/opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/dependency.rb:58:in `escape': no implicit conversion of nil into String (TypeError)

      Regexp.new("#{Regexp.escape(name)}(\s+\\(#{Regexp.escape(version)}\\))?")
                                                               ^^^^^^^
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/dependency.rb:58:in `uid_regexp'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/dependency.rb:62:in `block in exceptions'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/dependency.rb:62:in `select'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/dependency.rb:62:in `exceptions'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/dependency.rb:79:in `has_exception?'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/reporter.rb:196:in `block in generate_dependency_license_manifest'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/reporter.rb:191:in `each'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/reporter.rb:191:in `generate_dependency_license_manifest'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/reporter.rb:91:in `report'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/lib/license_scout/cli.rb:123:in `run'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/lib/ruby/gems/3.3.0/gems/license_scout-2.6.10/bin/license_scout:23:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/bin/license_scout:25:in `load'
	from /opt/hostedtoolcache/Ruby/3.3.4/x64/bin/license_scout:25:in `<main>'

This above was running on latest Ubuntu in a GitHub action.

I have tried various permutations of adding/specifying a version number, but get the same result.

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

No branches or pull requests

1 participant