klotho icon indicating copy to clipboard operation
klotho copied to clipboard

"Found conflicting dependencies in package.json"

Open ghost opened this issue 2 years ago • 3 comments

This happens in sample-apps/ts-cloudfs:

Found conflicting dependencies in package.json.
Found version of package, express = ^4.17.2.
Found version of package, express = ^4.18.1.
Using version ^4.17.2

I tried to fix these in #461, but those only catch the package.jsons from iac2 templates — these errors are coming from our runtime libs.

We should generalize factories_test.go so we can use it in more places, or maybe even consider moving it higher up in our tree (and probably skipping any node_modules dirs).

ghost avatar Jun 02 '23 15:06 ghost

Note: Go doesn't support **-style globbing for all subdirs, so this can't be quite as simple as "move the test to the top dir, and embed **/package.json".

ghost avatar Jun 02 '23 16:06 ghost

We use a library for ** globbing in embed assets, so we could use that.

gordon-klotho avatar Jun 02 '23 18:06 gordon-klotho

Yeah. That would require the test assuming PWD is the repo root (otherwise the fs.ReadFiles etc wouldn't work), but that's probably fine. I don't know offhand if go test mucks with PWD, but I think we can get away with saying "you have to be at repo root to run it".

Note that if we do that, we don't even need a library, or **-ness. We can do the full FS walk ourselves just as easily.

ghost avatar Jun 05 '23 15:06 ghost