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.
ensure-node-env
Advanced tools
A script that helps ensure you have the correct node & npm versions installed in your environment.
A script that helps ensure you have the correct node & npm versions installed globally in your environment.
Add the following to your package.json
:
...
"engines": {
"node": "^10.14.1",
"npm": "^6.4.1"
},
"scripts": {
"preinstall": "npx ensure-node-env",
...
Where the node
and npm
engine properties specify a valid semver range for Node and npm version respectively.
By default, if you have a
node
ornpm
binary installed locally to the project (thus ending up in./node_modules/.bin
), it will take precedence. If you want to check against a globally installed version instead, you can pass the--ignore-local-bin
parameter (-i
for short).It's worth noting that, while you may not be directly depending on
node
ornpm
packages, you may still have them as transitive dependencies - in any case,ensure-node-env
will show which one is being considered and where it comes from.
By default, the script's output is minimal. If you want it to display more information, such as the exact versions being compared, you can pass the --verbose
parameter (-v
for short).
This script is designed to be used as a development-only preinstall check in the project root. For libraries that are published and consumed in other projects it is considered good enough to include it as a pretest check:
npm install ensure-node-env --save-dev
...
"engines": {
"node": "^10.14.1",
"npm": "^6.4.1"
},
"scripts": {
"pretest": "ensure-node-env",
...
Skyscanner Node development requires Node LTS and npm ^16.14.2
. Nvm users can run nvm use
to switch to lts/gallium
. Nave users can use nave auto
. You can also download Node LTS using the website.
2.1.0 - 2024-06-17
10
to list of accepted versionsFAQs
A script that helps ensure you have the correct node & npm versions installed in your environment.
The npm package ensure-node-env receives a total of 475 weekly downloads. As such, ensure-node-env popularity was classified as not popular.
We found that ensure-node-env demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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.