Force a specific package manager to be used on a project
npm install only-allow> Force a specific package manager to be used on a project
Add a preinstall script to your project's package.json.
If you want to force npm, add:
``json`
{
"scripts": {
"preinstall": "npx only-allow@1.2.2 npm"
}
}
If you want to force cnpm, add:
`json`
{
"scripts": {
"preinstall": "npx only-allow@1.2.2 cnpm"
}
}
If you want to force pnpm, add:
`json`
{
"scripts": {
"preinstall": "npx only-allow@1.2.2 pnpm"
}
}
If you want to force yarn, add:
`json`
{
"scripts": {
"preinstall": "npx only-allow@1.2.2 yarn"
}
}
If you want to force bun, add:
`json``
{
"scripts": {
"preinstall": "npx only-allow@1.2.2 bun"
}
}