affaan-m/ECC · error · Error
ECC_NASIKO_CLI_EXECUTABLE must be an absolute path.
Error message
ECC_NASIKO_CLI_EXECUTABLE must be an absolute path.
What it means
resolveExecutable builds the path to the Nasiko CLI binary. When the ECC_NASIKO_CLI_EXECUTABLE environment variable (or a configured candidate) is a relative path, the script refuses to proceed because relative executable paths resolve unpredictably against the process CWD. It throws to force an unambiguous absolute path.
Solutions
- Set ECC_NASIKO_CLI_EXECUTABLE to a fully absolute path, e.g. /usr/local/bin/nasiko.
- Expand ~ and $HOME in your shell config before exporting: export ECC_NASIKO_CLI_EXECUTABLE="$HOME/bin/nasiko".
- Alternatively unset the env var so the script falls back to defaultExecutablePath().
- Use `readlink -f "$(which nasiko)"` to obtain an absolute path.
Example fix
// before export ECC_NASIKO_CLI_EXECUTABLE=./dist/nasiko // after export ECC_NASIKO_CLI_EXECUTABLE="$PWD/dist/nasiko"
Defensive patterns
Strategy: validation
Validate before calling
const exe = process.env.ECC_NASIKO_CLI_EXECUTABLE;
if (exe && !require('path').isAbsolute(exe)) throw new Error(`Set ECC_NASIKO_CLI_EXECUTABLE to an absolute path, got: ${exe}`); Type guard
const isAbsoluteExecPath = (v) => typeof v === 'string' && v.length > 0 && require('path').isAbsolute(v); Try / catch
try {
readStatus();
} catch (err) {
if (err.message.includes('must be an absolute path')) {
console.error('Fix ECC_NASIKO_CLI_EXECUTABLE: use path.resolve()/an absolute path.');
} else throw err;
} Prevention
- Export ECC_NASIKO_CLI_EXECUTABLE with $HOME or absolute paths only, never ./relative.
- Run `readlink -f $(which nasiko)` when generating the value.
- Keep the env var in one shared env file so it is defined consistently.
- Prefer unsetting the var and letting the script's default lookup work when unsure.
When it happens
Trigger: Setting ECC_NASIKO_CLI_EXECUTABLE to a relative value like './bin/nasiko' or 'nasiko-cli' (something not found on PATH via defaultExecutablePath), then calling readStatus/readInstall/uninstall which call resolveExecutable.
Common situations: Configuring the env var in .envrc or CI with a shell-relative path; assuming the script resolves paths against the repo root; moving a binary and updating the env var with a shortcut like '~/bin/nasiko' typoed as a relative fragment.
Understand the failure class
Background: "is not a valid" / "Invalid ... value" environment variable errors: how libraries validate env vars and what to do when they reject yours — this error's family across 48 libraries.
Related errors
- ENOENT
- must be an absolute path explicitly configured by the…
- Itô compute has no paper or dry-run success mode. No CLI…
- Path ' ' targets a system directory
- The canonical ito-compute-cli is unpublished and ECC will…
AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16).
Data as JSON: /api/errors/64642923e9d66e7c.
Report an issue: GitHub.
Appendix: source
Thrown at scripts/nasiko.js:75
function defaultExecutablePath() {
const normalized = normalizePlatform();
if (normalized.os === 'windows') {
return process.env.LOCALAPPDATA
? path.join(process.env.LOCALAPPDATA, 'nasiko', 'bin', normalized.binaryName)
: null;
}
return path.join(os.homedir(), '.local', 'bin', normalized.binaryName);
}
function resolveExecutable(options = {}) {
const configured = process.env.ECC_NASIKO_CLI_EXECUTABLE;
const normalized = normalizePlatform();
const candidate = options.installDir
? path.join(validateInstallDirectory(options.installDir), normalized.binaryName)
: configured || defaultExecutablePath();
if (!candidate) return null;
if (!path.isAbsolute(candidate)) {
throw new Error('ECC_NASIKO_CLI_EXECUTABLE must be an absolute path.');
}
return candidate;
}
function readStatus(options = {}) {
const executable = resolveExecutable(options);
if (!executable) return { installed: false, qualified: false, version: null, executable: null };
return inspectInstalledNasiko(executable);
}
function parseStatusArguments(argumentsList) {
let options = { installDir: undefined, json: false };
for (let index = 0; index < argumentsList.length; index += 1) {
const argument = argumentsList[index];
if (argument === '--json') options = { ...options, json: true };
else if (argument === '--install-dir') {
const value = argumentsList[index + 1];
if (!value || value.startsWith('--')) throw new Error('Missing value for --install-dir.');View on GitHub (pinned to 8321021c54)