{"record":{"id":"592180c2be4ab1a0","repo":"ReactiveX/rxjs","slug":"cannot-locate-the-rxjs-migrate-package-entry-poin","errorCode":null,"errorMessage":"Cannot locate the @rxjs/migrate package entry point.","messagePattern":"Cannot locate the @rxjs/migrate package entry point\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/migrate/src/skill-cli.ts","lineNumber":57,"sourceCode":"      harness: options.harness,\n      force: options.force,\n    });\n    writeJson(io.stdout, { schemaVersion: 1, status: 'completed', result });\n    return skillCliExitCodes.success;\n  } catch (error: unknown) {\n    const message = messageFor(error);\n    const refused = /refusing/i.test(message);\n    writeJson(io.stderr, {\n      schemaVersion: 1,\n      status: 'error',\n      error: { code: refused ? 'refused' : 'operational-failure', message },\n    });\n    return refused ? skillCliExitCodes.refused : skillCliExitCodes.operationalFailure;\n  }\n}\n\nexport async function resolveCanonicalSkillRoot(modulePath = process.argv[1]): Promise<string> {\n  if (!modulePath) throw new Error('Cannot locate the @rxjs/migrate package entry point.');\n  const moduleDirectory = dirname(resolve(modulePath));\n  for (const localPath of ['../skill', '../../skill']) {\n    const candidate = resolve(moduleDirectory, localPath);\n    try {\n      if ((await stat(join(candidate, 'SKILL.md'))).isFile()) return candidate;\n    } catch {\n      // Try the source-tree or built-package alternative.\n    }\n  }\n  throw new Error('Cannot locate the canonical Skill shipped by @rxjs/migrate.');\n}\n\nfunction parseSkillArguments(argv: readonly string[]): ParsedSkillCliOptions {\n  const action = argv[0];\n  if (action !== 'check' && action !== 'install' && action !== 'update' && action !== 'remove') {\n    throw new Error(\n      'Usage: rxjs-migrate-skill <check|install|update|remove> --harness <codex|claude|cursor> [--project-root <dir>] [--force]'\n    );","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/ReactiveX/rxjs/blob/54796b38a57e6309f9861e174737479bb3f63f61/packages/migrate/src/skill-cli.ts#L39-L75","documentation":"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.","triggerScenarios":"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.","commonSituations":"Running the skill CLI through a custom Node wrapper, jest/vitest importing the module, or bundling that strips argv.","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"],"exampleFix":"// before\nawait resolveCanonicalSkillRoot('');\n// after\nawait resolveCanonicalSkillRoot(require.resolve('@rxjs/migrate/dist/skill-cli.js'));","handlingStrategy":"validation","validationCode":"if (!process.argv[1]) throw new TypeError('argv[1] missing; invoke via the package bin');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Invoke via node_modules/.bin entry points","Pass explicit modulePath in embedded contexts"],"tags":["cli","environment","initialization"],"backgroundTag":"missing-entry-point","analyzedSha":"54796b38a57e6309f9861e174737479bb3f63f61","analyzedAt":"2026-08-28T10:21:27.410Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}