Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
The 'only-allow' npm package is used to enforce the use of a specific package manager in a project. This ensures that all contributors use the same package manager, which can help avoid issues related to package-lock files and dependency management.
Enforce npm usage
This feature ensures that npm is the only package manager allowed for the project. If a user tries to install dependencies using a different package manager, the installation will fail.
/* Add this to your package.json file */
{
"scripts": {
"preinstall": "npx only-allow npm"
}
}
Enforce yarn usage
This feature ensures that yarn is the only package manager allowed for the project. If a user tries to install dependencies using a different package manager, the installation will fail.
/* Add this to your package.json file */
{
"scripts": {
"preinstall": "npx only-allow yarn"
}
}
Enforce pnpm usage
This feature ensures that pnpm is the only package manager allowed for the project. If a user tries to install dependencies using a different package manager, the installation will fail.
/* Add this to your package.json file */
{
"scripts": {
"preinstall": "npx only-allow pnpm"
}
}
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:
{
"scripts": {
"preinstall": "npx only-allow npm"
}
}
If you want to force cnpm, add:
{
"scripts": {
"preinstall": "npx only-allow cnpm"
}
}
If you want to force pnpm, add:
{
"scripts": {
"preinstall": "npx only-allow pnpm"
}
}
If you want to force yarn, add:
{
"scripts": {
"preinstall": "npx only-allow yarn"
}
}
If you want to force bun, add:
{
"scripts": {
"preinstall": "npx only-allow bun"
}
}
FAQs
Force a specific package manager to be used on a project
The npm package only-allow receives a total of 215,413 weekly downloads. As such, only-allow popularity was classified as popular.
We found that only-allow demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.