
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
#force-npm
Force users to use
npminstead ofyarn.
If run from yarn instead of npm, the process will exit with error code 1
and print an error message.
Note: this will not work if used with yarn add --dev --ignore-scripts.
Note: This is fork of use-yarn
npm install --save-dev force-npm
# or
yarn add --dev force-npm
For example, in your package.json:
{
"scripts": {
"preinstall": "force-npm || ( npm install --save-dev --no-scripts --no-save force-npm && force-npm )"
}
}
Or if you're on npm >=5 or have npx:
{
"scripts": {
"preinstall": "npx force-npm"
}
}
You may provide a custom message via the -m flag:
{
"scripts": {
"preinstall": "npx force-npm -m 'Please use npm!'"
}
}
Or, you may also provide a custom message read from a file via the -f flag:
{
"scripts": {
"preinstall": "npx force-npm -f path/to/customMessage.txt"
}
}
You may disable force-npm by setting the DISABLE_FORCE_NPM environment variable to true:
{
"scripts": {
"preinstall": "DISABLE_FORCE_NPM=true npx force-npm"
}
}
var forceNpm = require('force-npm')
forceNpm()
// or a custom message
forceNpm('You idiot!')
FAQs
Force users to use npm instead of yarn.
We found that force-npm 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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

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