-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When SAF CLI starts, it outputs many MODULE_NOT_FOUND warnings related to the @mitre/emass_client package trying to find axios:
(node:13864) [MODULE_NOT_FOUND] Warning: ModuleLoadError
module: @oclif/core@3.27.0
task: findCommand (emasser:delete:artifacts)
plugin: @mitre/saf
root: /usr/local/lib/node_modules/@mitre/saf
code: MODULE_NOT_FOUND
message: [MODULE_NOT_FOUND] require failed to load /usr/local/lib/node_modules/@mitre/saf/lib/commands/emasser/delete/artifacts.js: Cannot find module '@mitre/emass_client/node_modules/axios'
This warning repeats for all emasser commands (~1200+ lines of warnings).
Impact
- Functional: Commands still work - this is a warning, not an error
- User Experience: Very noisy output obscures actual results
- CI/CD: Pollutes logs, makes debugging harder
Root Cause Analysis
@mitre/emass_client(v3.22.0) declaresaxios: ^1.6.1as a direct dependency- SAF CLI also has
axios: ^1.5.0as a dependency - npm hoists axios to SAF's top-level
node_modules/axios - The emass_client code does normal
require("axios")which should resolve via Node's module resolution - However, something is causing Node to look specifically in
@mitre/emass_client/node_modules/axiosinstead of walking up the tree
The generated emass_client code is standard:
// dist/api.js:93
var axios_1 = require("axios");This happens during oclif's findCommand discovery phase at startup.
Possible Fixes
- In emass_client: Change axios from
dependenciestopeerDependencies - In SAF CLI: Add axios version resolution/override
- Investigation needed: Check if this is an npm/node version issue or oclif module resolution behavior
Environment
- Observed in GitHub Actions CI (ubuntu-latest)
- SAF CLI installed globally via npm
- Node.js version from CI runner
Workaround
For now, stderr can be suppressed:
export NODE_NO_WARNINGS=1
saf summary --input results.json 2>/dev/nullRelated
- @mitre/emass_client: https://github.com/mitre/emass_client
- axios dependency declared at:
src/typescript_client/package.json
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working