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

only-allow a specific version of the package manager #5

Open
Ravi-Rajpurohit opened this issue Jan 20, 2022 · 6 comments
Open

only-allow a specific version of the package manager #5

Ravi-Rajpurohit opened this issue Jan 20, 2022 · 6 comments

Comments

@Ravi-Rajpurohit
Copy link

Hi,

Can I use only-allow with a specific version?

For example →

{
  "scripts": {
    "preinstall": "npx only-allow npm@8"
  }
}

If not, is it possible to have this feature?

Also, I would like to contribute in building this feature if not already available.

@Ravi-Rajpurohit
Copy link
Author

Why we need this feature?

Starting from NPM 7, the package-lock.json has a different version and there are too many changes.

So, if a team member is using NPM 6 and others are using NPM 7 the package-lock.json after each install is completely different for both.

It will be good to have this feature so that we can lock the package manager versions as well.

@Ravi-Rajpurohit
Copy link
Author

I think it is possible. 'which-pm-runs' also gives us a version number.

I am going ahead with this. Let me know if there is anything I should know.

@zkochan
Copy link
Member

zkochan commented Jan 22, 2022

The issue is that this package doesn't really work anymore as npm doesn't run preinstall before the actual install. So there is no way to block npm CLI.

@luckymore
Copy link

The issue is that this package doesn't really work anymore as npm doesn't run preinstall before the actual install. So there is no way to block npm CLI.

RR‘s meaning is detect the pm version when install,it'a realizable point.

@jcollum-nutrien
Copy link

You should be able to accomplish this with the engines declaration in package.json

@luckymore
Copy link

luckymore commented Jul 18, 2022

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

No branches or pull requests

4 participants