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

make output package order deterministic #16

Open
anhvu-accuracy opened this issue Jun 3, 2021 · 3 comments
Open

make output package order deterministic #16

anhvu-accuracy opened this issue Jun 3, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@anhvu-accuracy
Copy link

Hello,

When running the license checker 2 times on the same folder without any change on whole system between two runs,
the list of package order is not kept.

Therefore, the output of license checker cannot be added in a repository to track license changes.

Thanks

@RSeidelsohn RSeidelsohn self-assigned this Oct 13, 2021
@RSeidelsohn RSeidelsohn added bug Something isn't working good first issue Good for newcomers labels Oct 13, 2021
@RSeidelsohn
Copy link
Owner

Hello @anhvu-accuracy ,

sorry for the late reaction. I currently have the time to take care of this project and just tried to reproduce your issue, but to no avail. Could you please provide me with more information regarding your problem?

Which OS are you observing this under and what exact command do you use?
You are right assuming that the output order should always be the same if nothing else changes. And this works fine on my machine when I simply run it in my terminal.

Cheers, Roman.

@anhvu-accuracy
Copy link
Author

Hello @RSeidelsohn

No problem for the delay, this is not critical at all. The output is the same when running on the same machine.
But in our team, some guys use MacOs, some use Windows 10, other use Linux. The order of package might change.
I did not narrow the exact cause. Analysis is not easy, indeed.
I'll get back to you when I better understand how it occurs.

Anh-Vu

@ehoogeveen-medweb
Copy link

I noticed that the sort order on Windows doesn't match the sorting order in package.json, which I think would probably be the preferred sorting order. The sorting order (with --direct) looks like it matches the order of the directories in node_modules. Here's an example:

package.json:

		"vue": "^2.6.14",
		"vue-router": "^3.5.3",
		"vue-tables-2": "~1.5.46",

license-checker-rseidelsohn --direct --markdown:

[vue-router@3.5.3](https://github.com/vuejs/vue-router) - MIT
[vue-tables-2@1.5.46](https://github.com/matfish2/vue-tables-2) - MIT
[vue@2.6.14](https://github.com/vuejs/vue) - MIT

npm actually had a fairly recent change to sort the same way regardless of the user's locale: npm/cli#3203

@RSeidelsohn RSeidelsohn removed the good first issue Good for newcomers label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants