A simple way to force package-manager in your project.
Add a preinstall
script in your project's package.json
, like this:
{
"scripts": {
"preinstall": "npx pm-keeper npm"
}
}
And force the package-manager's version
{
"scripts": {
"preinstall": "npx pm-keeper [email protected]"
}
}
or
{
"scripts": {
"preinstall": "npx pm-keeper npm 6.14.11"
}
}
Of course, you can set a options in your package.json
, like this:
{
"scripts": {
"preinstall": "npx pm-keeper"
},
"pmKeeper": {
"name": "npm",
"version": "6.14.1" // optional
}
}
have fun