Skip to content

--onlyDirectDependencies option returns 0 results if package.json is missing a 'name' property #42

@ATClemente

Description

@ATClemente

This may be a bit of a unique scenario but I ran into an issue using npm-licence-crawler with an Expo project I am working on. I thought it would be relatively straightforward as I was following an article from the expo blog: https://blog.expo.io/licenses-the-best-part-of-your-app-29e7285b544f

I found that when running with the --onlyDirectDependencies option, I would always get 0 results. Running with the --dependencies flag returned a large number of results as expected.

I checked the code and determined this was because my package.json has no "name" property. Confirmed that adding a "name" property allows me to get results. My package.json file is this way because by default an Expo project is created with a package.json file that has no "name" property. Instead there is a name property put into an app.json file. Not sure if this has changed since the linked article was written.

I don't know if there are other node projects that could potentially be setup in a way that they would not have a name property so this might just be something people using expo need to watch out for. But perhaps its a scenario that could be handled somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions