Skip to content

Fails to parse license when node_modules directory is present #310

Description

@kv-mahlberg

Describe the bug
When node.js packages are installed into the project directory, cargo-about fails to parse the rust dependencies. The problem is resolved by removing the node_modules subdirectory from the project directory.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new crate and add a simple dependency
name = "test-app"
version = "0.1.0"
edition = "2024"

[dependencies]
random = "0.14.1"
  1. Generate license report. This outputs a warning that our application has no license, but successfully generates a report.
> cargo about init
> cargo about generate .\about.hbs -o about.html
2026-08-11T09:21:04.2791767Z [WARN] crate 'test-app 0.1.0' doesn't have a license field
2026-08-11T09:21:04.2956851Z [WARN] unable to synthesize license expression for 'test-app 0.1.0': no `license` specified, and no license files were found
  1. Install a node package in the project root.
> npm install license-checker
  1. Run cargo about again. This time it fails to generate a report and outputs a very confusing error message.
> cargo about generate .\about.hbs -o about.html
2026-08-11T09:24:47.6023105Z [WARN] crate 'test-app 0.1.0' doesn't have a license field
error: failed to satisfy license requirements
  ┌─ C:\Users\maah\Dev\test\test-app\Cargo.toml:4:42
  │
4 │ edition = "2license = "(Apache-2.0) AND (BSD-2-Clause) AND (BSD-3-Clause) AND (ISC) AND (MIT)"
  │                                          ------------       ------------       ---

2026-08-11T09:24:47.7024076Z [ERROR] encountered 1 errors resolving licenses, unable to generate output

The same error occurs even if I install the node package in a subdirectory:

> mkdir build
> cd build
> npm install license-checker

Expected behavior
Cargo about should not be affected by the presence of node_modules or package.json.

Device:

  • OS: Windows 11
  • Shell: PowerShell
  • Cargo-about version: 0.9.1

Additional context
What I'm trying to achieve is to generate dependency lists from cargo and npm for a Tauri project that has a workspace and the Tauri application in a subdirectory. For this I need license-checker and I don't want to install it in the Tauri package's node_modules and have it listed in the license file so I install it in the workspace root.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions