Fission-AI/OpenSpec · error

Path is not writable

Error message

Path is not writable: ${targetPath}

What it means

Thrown by the zsh completion installer's install routine when the target install path (completion directory or file) is not writable by the current user. The install/update of the completion script cannot proceed; the at-fault input is targetPath, and the user typically needs to fix directory permissions or choose another install location.

Solutions

  1. Check permissions on the zsh completion directory (~/.zsh/completions or the Oh My Zsh custom dir)
  2. Create the directory if missing and ensure it is user-writable
  3. Retry installation after restoring write access
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/core/completions/installers/zsh-installer.ts:273 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/e558f8603a0607bf. Report an issue: GitHub.

Appendix: source

Thrown at src/core/completions/installers/zsh-installer.ts:273

            success: true,
            installedPath: targetPath,
            isOhMyZsh,
            message: 'Completion script is already installed (up to date)',
            instructions: [
              'The completion script is already installed and up to date.',
              'If completions are not working, try: exec zsh',
            ],
          };
        }
        // File exists but content is different - this is an update
        isUpdate = true;
      } catch (error: any) {
        // File doesn't exist or can't be read, proceed with installation
        console.debug(`Unable to read existing completion file at ${targetPath}: ${error.message}`);
      }

      if (!(await FileSystemUtils.canWriteFile(targetPath))) {
        throw new Error(`Path is not writable: ${targetPath}`);
      }

      // Ensure the directory exists
      const targetDir = path.dirname(targetPath);
      await fs.mkdir(targetDir, { recursive: true });

      // Backup existing file if updating
      const backupPath = isUpdate ? await this.backupExistingFile(targetPath) : undefined;

      // Write the completion script
      await fs.writeFile(targetPath, completionScript, 'utf-8');

      // Auto-configure .zshrc for standard Zsh only.
      // Oh My Zsh loads custom/completions and runs compinit itself.
      let zshrcConfigured = false;
      if (!isOhMyZsh) {
        zshrcConfigured = await this.configureZshrc(targetDir);
      }

View on GitHub (pinned to 6926ccb18a)