Skip to content

Force a specific package manager to be used on a project

License

Notifications You must be signed in to change notification settings

luckymore/only-allow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

only-allow2

需求来源于业务:https://juejin.cn/post/7067198104092540935

Force a specific package manager and it's version to be used on a project

Usage

Add a preinstall script to your project's package.json.

support:

  • npm
  • cnpm
  • yarn
  • pnpm

If you want to force npm, add:

{
  "scripts": {
    "preinstall": "npx only-allow2 npm"
  }
}

If you want to force package manager version, add:

{
  "scripts": {
    "preinstall": "npx only-allow2 [email protected]"
  }
}

License

MIT

About

Force a specific package manager to be used on a project

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%