ReactiveX/rxjs · error · Error
Cannot locate the @rxjs/migrate package entry point.
Error message
Cannot locate the @rxjs/migrate package entry point.
What it means
Thrown by resolveCanonicalSkillRoot when process.argv[1] (or the supplied modulePath) is empty, so the CLI cannot locate its own entry-point directory to find the shipped skill files. It means the skill CLI was invoked in a way that leaves no entry module path.
Source
Thrown at packages/migrate/src/skill-cli.ts:57
harness: options.harness,
force: options.force,
});
writeJson(io.stdout, { schemaVersion: 1, status: 'completed', result });
return skillCliExitCodes.success;
} catch (error: unknown) {
const message = messageFor(error);
const refused = /refusing/i.test(message);
writeJson(io.stderr, {
schemaVersion: 1,
status: 'error',
error: { code: refused ? 'refused' : 'operational-failure', message },
});
return refused ? skillCliExitCodes.refused : skillCliExitCodes.operationalFailure;
}
}
export async function resolveCanonicalSkillRoot(modulePath = process.argv[1]): Promise<string> {
if (!modulePath) throw new Error('Cannot locate the @rxjs/migrate package entry point.');
const moduleDirectory = dirname(resolve(modulePath));
for (const localPath of ['../skill', '../../skill']) {
const candidate = resolve(moduleDirectory, localPath);
try {
if ((await stat(join(candidate, 'SKILL.md'))).isFile()) return candidate;
} catch {
// Try the source-tree or built-package alternative.
}
}
throw new Error('Cannot locate the canonical Skill shipped by @rxjs/migrate.');
}
function parseSkillArguments(argv: readonly string[]): ParsedSkillCliOptions {
const action = argv[0];
if (action !== 'check' && action !== 'install' && action !== 'update' && action !== 'remove') {
throw new Error(
'Usage: rxjs-migrate-skill <check|install|update|remove> --harness <codex|claude|cursor> [--project-root <dir>] [--force]'
);View on GitHub (pinned to 54796b38a5)
Solutions
- Invoke the CLI via its normal bin entry (node_modules/.bin/rxjs-migrate-skill) rather than a custom wrapper
- Pass an explicit modulePath argument pointing at the CLI entry file
- Check that Node's process.argv[1] is populated in your invocation context
Example fix
// before
await resolveCanonicalSkillRoot('');
// after
await resolveCanonicalSkillRoot(require.resolve('@rxjs/migrate/dist/skill-cli.js')); Defensive patterns
Strategy: validation
Validate before calling
if (!process.argv[1]) throw new TypeError('argv[1] missing; invoke via the package bin'); Prevention
- Invoke via node_modules/.bin entry points
- Pass explicit modulePath in embedded contexts
When it happens
Trigger: Calling resolveCanonicalSkillRoot() in an environment where process.argv[1] is unset/empty (some bundlers, REPLs, or test runners), or explicitly passing an empty string as modulePath.
Common situations: Running the skill CLI through a custom Node wrapper, jest/vitest importing the module, or bundling that strips argv.
Related errors
- Unknown mode: ${mode}
- Unknown framework: ${framework}
- Unknown option: ${argument}
- Missing required argument${missing.length === 1 ? '' : 's'}:
- --out-dir is required with --write
AI-assisted analysis of ReactiveX/rxjs@54796b38a5 (2026-08-28).
Data as JSON: /api/errors/592180c2be4ab1a0.
Report an issue: GitHub.