{"record":{"id":"37f72783b31f2b15","repo":"microsoft/typescript-go","slug":"publishedtypescriptaliaspackagename-should-alia","errorCode":null,"errorMessage":"${publishedTypeScriptAliasPackageName} should alias the typescript package, but found ${packageJson.name}.","messagePattern":"(.+?) should alias the typescript package, but found (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"Herebyfile.mjs","lineNumber":2207,"sourceCode":"    hiddenFromTaskList: true,\r\n    dependencies: options.forRelease || usePublishedPlatformPackagesForVsix ? undefined : [buildNativePreviewPackages, cleanSignTempDirectory],\r\n    run: runPackVsixExtensions,\r\n});\r\n\r\n/** @type {Map<string, Promise<string>>} */\r\nconst publishedPlatformPackageLibDirs = new Map();\r\n\r\nconst getPublishedTypeScriptPackageJson = memoize(() => {\r\n    const candidates = [\r\n        path.join(extensionDir, \"node_modules\", publishedTypeScriptAliasPackageName, \"package.json\"),\r\n        path.join(__dirname, \"node_modules\", publishedTypeScriptAliasPackageName, \"package.json\"),\r\n    ];\r\n\r\n    for (const candidate of candidates) {\r\n        if (fs.existsSync(candidate)) {\r\n            const packageJson = JSON.parse(fs.readFileSync(candidate, \"utf8\"));\r\n            if (packageJson.name !== \"typescript\") {\r\n                throw new Error(`${publishedTypeScriptAliasPackageName} should alias the typescript package, but found ${packageJson.name}.`);\r\n            }\r\n            if (!packageJson.version || typeof packageJson.version !== \"string\") {\r\n                throw new Error(`${publishedTypeScriptAliasPackageName} package.json did not contain a version.`);\r\n            }\r\n            if (!packageJson.optionalDependencies || typeof packageJson.optionalDependencies !== \"object\") {\r\n                throw new Error(`${publishedTypeScriptAliasPackageName} package.json did not contain platform optionalDependencies.`);\r\n            }\r\n            return packageJson;\r\n        }\r\n    }\r\n\r\n    throw new Error(`Could not find ${publishedTypeScriptAliasPackageName}; run npm install first.`);\r\n});\r\n\r\nfunction getPublishedTypeScriptVersion() {\r\n    const version = getPublishedTypeScriptPackageJson().version;\r\n    const expectedVersion = getVersion();\r\n    if (usePublishedPlatformPackagesForVsix && version !== expectedVersion) {\r","sourceCodeStart":2189,"sourceCodeEnd":2225,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/Herebyfile.mjs#L2189-L2225","documentation":"getPublishedTypeScriptPackageJson (Herebyfile.mjs, memoized) resolves `@typescript/bundled-typescript` — an npm alias that must redirect to the real `typescript` package — under `_extension/node_modules` or the repo-root `node_modules`, parses its package.json, and first checks `name === \"typescript\"`. Any other name means the resolved package is not a typescript alias, so every downstream version and platform lookup would be wrong, and it throws.","triggerScenarios":"A VSIX build that uses published platform packages (usePublishedPlatformPackagesForVsix) while the installed `@typescript/bundled-typescript` directory contains a package whose package.json `name` is not \"typescript\" — a stale fork, a renamed package, a manually vendored directory, or a bad alias resolution.","commonSituations":"A corrupted or partially-written node_modules entry from an interrupted npm install; someone replaced the alias with a real package under that scope; a lockfile or .npmrc change pointing the alias at a fork.","solutions":["Inspect the `name` field in `_extension/node_modules/@typescript/bundled-typescript/package.json` and in root `node_modules/@typescript/bundled-typescript/package.json` to find which candidate is wrong","Delete the offending `@typescript/bundled-typescript` directory (or both node_modules trees) and re-run `npm install` at the repo root","Check the package-lock entry for `@typescript/bundled-typescript` still resolves to a package named `typescript`, and that no .npmrc override redirects the registry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate the alias package.json before starting the VSIX pipeline\nfunction validateAliasName(p) {\n  const pj = JSON.parse(fs.readFileSync(p, \"utf8\"));\n  if (pj.name !== \"typescript\") {\n    throw new Error(`${p} resolved to \"${pj.name}\", expected \"typescript\" — reinstall`);\n  }\n  return pj;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `npm install` at the repo root after every branch switch or version bump","Never hand-edit or partially copy directories under node_modules","Keep @typescript/bundled-typescript pinned via the committed package-lock.json"],"tags":["npm","dependencies","packaging","vsix","build"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}