{"record":{"id":"1d9343b3e1d150bc","repo":"affaan-m/ECC","slug":"refusing-to-remove-an-unqualified-or-modified-nasi","errorCode":null,"errorMessage":"Refusing to remove an unqualified or modified Nasiko executable.","messagePattern":"Refusing to remove an unqualified or modified Nasiko executable\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/nasiko-release.js","lineNumber":322,"sourceCode":"  const installDirectory = validateInstallDirectory(options.installDir || defaultInstallDirectory(release, dependencies.environment || process.env, dependencies.homeDirectory || os.homedir()));\n  const destination = path.join(installDirectory, release.binaryName);\n  const plan = { dryRun: Boolean(options.dryRun), version, destination };\n  if (options.dryRun) return plan;\n  if (!options.yes) throw new Error('Nasiko uninstall requires explicit --yes consent.');\n  if (!fs.existsSync(installDirectory)) return { ...plan, dryRun: false, removed: false };\n  assertPrivateInstallDirectory(installDirectory);\n  const releaseLock = acquireLifecycleLock(installDirectory);\n  const metadataPath = metadataPathFor(destination);\n  const suffix = `${process.pid}-${crypto.randomBytes(6).toString('hex')}`;\n  const binaryTombstone = `${destination}.remove-${suffix}`;\n  const metadataTombstone = `${metadataPath}.remove-${suffix}`;\n  let binaryStaged = false;\n  let metadataStaged = false;\n  const rename = dependencies.rename || fs.renameSync;\n  try {\n    const status = (dependencies.inspectInstalled || inspectInstalledNasiko)(destination);\n    if (!status.installed) return { ...plan, dryRun: false, removed: false };\n    if (!status.qualified || status.version !== version) throw new Error('Refusing to remove an unqualified or modified Nasiko executable.');\n    rename(destination, binaryTombstone);\n    binaryStaged = true;\n    rename(metadataPath, metadataTombstone);\n    metadataStaged = true;\n    const cleanupPending = [];\n    try { fs.rmSync(metadataTombstone); } catch (_error) { cleanupPending.push(metadataTombstone); }\n    metadataStaged = false;\n    try { fs.rmSync(binaryTombstone); } catch (_error) { cleanupPending.push(binaryTombstone); }\n    binaryStaged = false;\n    return { ...plan, dryRun: false, removed: true, cleanupPending };\n  } catch (error) {\n    if (metadataStaged && !fs.existsSync(metadataPath)) rename(metadataTombstone, metadataPath);\n    if (binaryStaged && !fs.existsSync(destination)) rename(binaryTombstone, destination);\n    throw error;\n  } finally { releaseLock(); }\n}\n\nmodule.exports = { QUALIFIED_RELEASES, REGISTRY_ORIGIN, acquireLifecycleLock, digestBytes, extractQualifiedTarGzip, fetchBytes, getQualifiedRelease, inspectInstalledNasiko, installNasiko, normalizePlatform, uninstallNasiko, validateInstallDirectory };","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/lib/nasiko-release.js#L304-L340","documentation":"The uninstall safety check inspected the existing executable at the destination and it is either unqualified (not an ECC-pinned release) or its digest no longer matches the receipt. The uninstaller only removes binaries it can prove it installed and that have not been modified since.","triggerScenarios":"Thrown at scripts/lib/nasiko-release.js:322 when the library encounters an invalid state.","commonSituations":"Raised when input validation fails because: Refusing to remove an unqualified or modified Nasiko executable.. Typically caused by a missing, malformed, or out-of-range argument or configuration value.","solutions":["Provide a value that satisfies the validation: Refusing to remove an unqualified or modified Nasiko executable.","Check the calling command or configuration for the reported field and correct it, then retry.","Run the command with --help to review the expected input shape and allowed values."],"exampleFix":"Correct the invalid input so that the following holds: Refusing to remove an unqualified or modified Nasiko executable.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}