-
Notifications
You must be signed in to change notification settings - Fork 47
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
--onlyDirectDependencies option returns 0 results if package.json is missing a 'name' property #42
Comments
Thank you very much for your report. I'll check if it is possible to add a tweak to support Expo projects. Strictly speaking package.json file must have a name property as far as I understanding this, see https://docs.npmjs.com/files/package.json |
@EvanBacon Apparently, a new Expo project is created with a package.json file that has no "name" property by default. Instead there is a name property put into an app.json file. Did you also experience this behavior at the time of writing and what is your view on this? My understanding is that a package.json descriptor shall have a name assigned, see https://docs.npmjs.com/files/package.json |
Any updates on this? |
I was able to get around this by adding
|
@Kiesco08 's solution worked for me. |
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?
The text was updated successfully, but these errors were encountered: