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

Consider providing an npm-lock file before installing html-validate #7

Open
sarahelsaig opened this issue Dec 10, 2023 · 2 comments
Open

Comments

@sarahelsaig
Copy link

A followup to the discussion in Lombiq/UI-Testing-Toolbox#327 (comment).

As a reminder, the idea is that if the HtmlValidatePackageVersion is not changed, a prepared lock file may be copied into the working directory before the NPM install is called.

@YevgeniyShunevych
Copy link
Member

Basically, I'm OK with the idea. But I have an issue with package-lock.json in global install mode. It seems like npm just ignores package-lock.json when I do something like npm install -g [email protected] --save-exact and have a particular package-lock.json in the working directory. So it just installs the latest version of dependecy. On the other hand, npm install [email protected] --save-exact (without -g) respects the dependency versions from package-lock.json, and I see correct dependency version in node_modules. But anyway, we need global installation. Perhaps some npm arguments needed or something else, but I didn't have luck so far. Maybe you @sarahelsaig have more experience with npm, and can help resolve that?

@sarahelsaig
Copy link
Author

You are right, package locks are not respected for global installs. Though I wonder if having both global installation and a version selector won't cause conflicts if a project actually sets it to a non-default value anyway. Without version selectors we could carry a zip of the default version and copy it into the "$(npm config get prefix)\node_modules" path. Without global we could just use a package lock.

I also heard that npm-shrinkwrap should work since that's the portable version, but it looks like they intentionally don't support it. It may be possible to navigate to the prefix directory, move the lock file there and install a package as if it was a local target, but then it acts as if all the dependencies were globally installed too so that's very messy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants