
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
force-resolutions
Advanced tools
This package modifies package-lock.json to force the installation of specified versions of transitive dependencies
This package modifies package-lock.json to force the installation of specified versions of a set of transitive dependencies (dependencies of dependencies).
resolutions with the dependency version you want to fix at the main level of your package.json.Example:
"resolutions": {
"ssri": "8.0.5"
}
package-lock.json file before every npm install:"scripts": {
"preinstall": "npx force-resolutions"
}
npm install
Remember that whenever you run npm install, the preinstall command will run automatically.
If a package.lock.json is not detected the script will not run, and any other command after it will be executed as normal.
npm ls ssri
NodeJS and NPM versions NodeJS version:
v16.13.1
NPM version:
8.1.2
Instructions
npm install
npm run build
cd dist
Copy a package.json and a package-lock.json file into the dist folder
Add a resolutions field in the package.json and inside of it a package to override
Run the compiled file
node index.js
This project was created because npm-force-resolutions became not suitable for the necesities the team I was working in had. We needed to avoid triggering the execution of the script when there was no package-lock.json, descriptive error logs, descriptive logs during the execution, faster download times, compatibility with multiple npm versions and faster execution times.
To simplify communication I have created a discord community, if you detect an issue with this package or want to improve it in some way, you can contact me here:
See other versions of the package on NPM
This project was inspired by the next package: npm-force-resolutions.
Special thanks to Denis Gulin for contributing to fix issues that were happening with the package and improving the code.
FAQs
This package modifies package-lock.json to force the installation of specified versions of transitive dependencies
The npm package force-resolutions receives a total of 34,685 weekly downloads. As such, force-resolutions popularity was classified as popular.
We found that force-resolutions 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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.