ioBroker / testing

Shared testing utilities for ioBroker
MIT License
8 stars 12 forks source link

Uninstall adapter from package-lock.json only before re-installing tarball #613

Closed MiSchroe closed 3 months ago

MiSchroe commented 3 months ago

Fixes #612

MiSchroe commented 3 months ago

@AlCalzone Renaming the tarball wouldn't help. npm install will lookup the package by its name not by the filename. Then it checks against the package-lock.json (and there is another one in the node_modules folder) where it will find it. And after finding a reference in the package-lock.json it takes the checksum from there, finds the package based on the old checksum in the cache and installs it from there.

I have found another solution:

  1. npm pack (like it is implemented already)
  2. Run npm uninstall <adapter> --package-lock-only -> Deletes the entries from the package-lock.json files without removing files from the node_modules folder.
  3. Install the adapter as it implemented right now.

The advantage:

If this is a feasible solution I can change this pull request accordingly.

mcm1957 commented 3 months ago

Why using --pachage-lock-only? The adapter will be installed afterwards anyway. And removing any rest of the adapter can only improve testing.

MiSchroe commented 3 months ago

Why using --pachage-lock-only? The adapter will be installed afterwards anyway. And removing any rest of the adapter can only improve testing.

That would uninstall the dependencies, too.

mcm1957 commented 3 months ago

Ok would cause some time. But would ensure to install deps exactly as listed in package.json. if changed.Pro and contra.

But yes could be too much overhead for major Situations

AlCalzone commented 3 months ago

@MiSchroe I think it is worth a shot