affaan-m/ECC · error · Error

Refusing to remove an unqualified or modified Nasiko executa

Error message

Refusing to remove an unqualified or modified Nasiko executable.

What it means

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.

Source

Thrown at scripts/lib/nasiko-release.js:322

  const installDirectory = validateInstallDirectory(options.installDir || defaultInstallDirectory(release, dependencies.environment || process.env, dependencies.homeDirectory || os.homedir()));
  const destination = path.join(installDirectory, release.binaryName);
  const plan = { dryRun: Boolean(options.dryRun), version, destination };
  if (options.dryRun) return plan;
  if (!options.yes) throw new Error('Nasiko uninstall requires explicit --yes consent.');
  if (!fs.existsSync(installDirectory)) return { ...plan, dryRun: false, removed: false };
  assertPrivateInstallDirectory(installDirectory);
  const releaseLock = acquireLifecycleLock(installDirectory);
  const metadataPath = metadataPathFor(destination);
  const suffix = `${process.pid}-${crypto.randomBytes(6).toString('hex')}`;
  const binaryTombstone = `${destination}.remove-${suffix}`;
  const metadataTombstone = `${metadataPath}.remove-${suffix}`;
  let binaryStaged = false;
  let metadataStaged = false;
  const rename = dependencies.rename || fs.renameSync;
  try {
    const status = (dependencies.inspectInstalled || inspectInstalledNasiko)(destination);
    if (!status.installed) return { ...plan, dryRun: false, removed: false };
    if (!status.qualified || status.version !== version) throw new Error('Refusing to remove an unqualified or modified Nasiko executable.');
    rename(destination, binaryTombstone);
    binaryStaged = true;
    rename(metadataPath, metadataTombstone);
    metadataStaged = true;
    const cleanupPending = [];
    try { fs.rmSync(metadataTombstone); } catch (_error) { cleanupPending.push(metadataTombstone); }
    metadataStaged = false;
    try { fs.rmSync(binaryTombstone); } catch (_error) { cleanupPending.push(binaryTombstone); }
    binaryStaged = false;
    return { ...plan, dryRun: false, removed: true, cleanupPending };
  } catch (error) {
    if (metadataStaged && !fs.existsSync(metadataPath)) rename(metadataTombstone, metadataPath);
    if (binaryStaged && !fs.existsSync(destination)) rename(binaryTombstone, destination);
    throw error;
  } finally { releaseLock(); }
}

module.exports = { QUALIFIED_RELEASES, REGISTRY_ORIGIN, acquireLifecycleLock, digestBytes, extractQualifiedTarGzip, fetchBytes, getQualifiedRelease, inspectInstalledNasiko, installNasiko, normalizePlatform, uninstallNasiko, validateInstallDirectory };

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Provide a value that satisfies the validation: Refusing to remove an unqualified or modified Nasiko executable.
  2. Check the calling command or configuration for the reported field and correct it, then retry.
  3. Run the command with --help to review the expected input shape and allowed values.

Example fix

Correct the invalid input so that the following holds: Refusing to remove an unqualified or modified Nasiko executable.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scripts/lib/nasiko-release.js:322 when the library encounters an invalid state.

Common situations: 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.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/1d9343b3e1d150bc. Report an issue: GitHub.