Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Users reported installation failures for both npm install -g @clduab11/gemini-flow and gemini extensions install https://github.com/clduab11/gemini-flow. The errors indicated missing configuration files and ES module issues, though the actual code was correct (using .cjs extension properly).

Changes

package.json

  • Added explicit files field listing all publishable directories and files
  • Ensures critical files (gemini-extension.json, postinstall.cjs, extension-loader.js) are always included in npm package
  • Prevents npm version inconsistencies in package resolution

INSTALLATION_TROUBLESHOOTING.md (new)

  • Documents three installation methods: npm global, Gemini CLI extension, local development
  • Provides solutions for common errors (ES module conflicts, permission issues, cache problems)
  • Includes environment requirements and verification commands

README.md

  • Added all three installation methods with clear examples
  • Linked to troubleshooting guide

Context

The reported errors referenced postinstall.js but the codebase correctly uses postinstall.cjs. The issues likely stemmed from npm cache or environment-specific behavior. Without an explicit files field, npm's default inclusion logic can vary across versions, potentially omitting critical files like gemini-extension.json from the published package.

Verification

# Package now includes all critical files
tar -tzf clduab11-gemini-flow-*.tgz | grep -E "(gemini-extension|postinstall|extension-loader)"
# package/gemini-extension.json
# package/scripts/postinstall.cjs
# package/extensions/gemini-cli/extension-loader.js

# Extension loader resolves manifest correctly
node -e "import('./extensions/gemini-cli/extension-loader.js').then(m => {
  const ext = new m.GeminiFlowExtension();
  console.log(ext.loadManifest()); // Works in global install location
})"
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: gemini extensions install and npm install -g fail for gemini-flow</issue_title>
<issue_description>### Version

0.11.3

Environment

Node.js

What happened?

When attempting to install gemini-flow using either gemini extensions install https://github.com/clduab11/gemini-flow or npm install -g @clduab11/gemini-flow,
the installation fails.

Steps to Reproduce:

  1. Using gemini extensions install:
    1 gemini extensions install https://github.com/clduab11/gemini-flow

  2. Using npm install -g:
    1 npm install -g @clduab11/gemini-flow

Expected Behavior:

Actual Behavior:

  1. gemini extensions install fails with the following error:
    1 Configuration file not found at C:\Users\dasbl\AppData\Local\Temp\gemini-extension<random_string>\gemini-extension.json
    This is despite the fact that https://raw.githubusercontent.com/clduab11/gemini-flow/main/gemini-extension.json is accessible.

  2. npm install -g fails with the following error:

1 ReferenceError: require is not defined in ES module scope, you can use import instead
2 This file is being treated as an ES module because it has a '.js' file extension and
'C:\Users\dasbl\AppData\Roaming\npm\node_modules@clduab11\gemini-flow\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to
use the '.cjs' file extension.
3 at file:///C:/Users/dasbl/AppData/Roaming/npm/node_modules/@clduab11/gemini-flow/scripts/postinstall.js:8:22

Expected behavior

The gemini-flow extension should install successfully.

Steps to reproduce

  1. Using gemini extensions install:
    gemini extensions install https://github.com/clduab11/gemini-flow

  2. Using npm install -g:
    npm install -g @clduab11/gemini-flow

Relevant log output

1. `gemini extensions install` fails with the following error:
Configuration file not found at C:\Users\dasbl\AppData\Local\Temp\gemini-extension<random_string>\gemini-extension.json
      This is despite the fact that https://raw.githubusercontent.com/clduab11/gemini-flow/main/gemini-extension.json is accessible.

   2. `npm install -g` fails with the following error:

 ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and
     'C:\Users\dasbl\AppData\Roaming\npm\node_modules\@clduab11\gemini-flow\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to
     use the '.cjs' file extension.
at file:///C:/Users/dasbl/AppData/Roaming/npm/node_modules/@clduab11/gemini-flow/scripts/postinstall.js:8:22

Additional context

No response</issue_description>

<agent_instructions>@github-copilot, please analyze and auto-fix this issue.

Issue Title: gemini extensions install and npm install -g fail for gemini-flow
Version: 0.11.3
Environment: Node.js

Problem summary:
Both gemini extensions install https://github.com/clduab11/gemini-flow and npm install -g @clduab11/gemini-flow fail to install successfully.

Error details:

  • gemini extensions install fails with:
    Configuration file not found at C:\Users\dasbl\AppData\Local\Temp\gemini-extension\gemini-extension.json
    (but https://raw.githubusercontent.com/clduab11/gemini-flow/main/gemini-extension.json is accessible)
  • npm install -g fails with:
    ReferenceError: require is not defined in ES module scope, you can use import instead
    (file is treated as ES module due to .js extension and "type": "module" in package.json; suggest renaming to .cjs or refactoring imports)
    at file:///C:/Users/dasbl/AppData/Roaming/npm/node_modules/@clduab11/gemini-flow/scripts/postinstall.js:8:22
    

Expected behavior:
gemini-flow extension and npm package should install successfully.

Steps to Reproduce:

  1. gemini extensions install https://github.com/clduab11/gemini-flow
  2. npm install -g @clduab11/gemini-flow

Relevant log output:
See error messages above.

Action requested:
Auto-analyze/code fix for:

  • file/module type incompatibilities
  • config file resolution
  • install success for both methods

1</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix installation issues for gemini-flow Fix npm package manifest to resolve installation failures Nov 14, 2025
Copilot AI requested a review from clduab11 November 14, 2025 02:25
clduab11 pushed a commit that referenced this pull request Nov 16, 2025
…ready implementations

BREAKING: None - All changes backward compatible with feature flags

🔒 SECURITY IMPLEMENTATIONS:
- Issue #67: Implement WebSocket authentication (JWT + API key)
- Issue #69: Enforce API key requirement in production
- Issue #70: Implement request payload size validation
- Add comprehensive security headers via Helmet
- Add rate limiting with persistence

💾 INFRASTRUCTURE IMPROVEMENTS:
- Issue #68: Implement atomic file operations with rollback
- Issue #73: Implement automated database backup system
- Issue #75: Persist rate limit data across restarts
- Issue #74: Implement Prometheus metrics collection
- Issue #81: Verify multi-stage Docker build (already implemented)

🚀 API ENHANCEMENTS:
- Issue #82: Add default pagination limits for list endpoints
- Add cursor-based pagination support
- Add sorting and filtering middleware
- Add HATEOAS-style pagination links

🐛 BUG FIXES:
- Issue #96: Fix npm install failures (ffmpeg-static)
- Issue #97: Fix package manifest issues
- Issue #98: Fix critical installation bugs
- Move problematic dependencies to optionalDependencies

✅ TESTING & QUALITY:
- Issue #79: Implement comprehensive API test suite
- Issue #93/#94: Create automated console.log replacement script
- Add tests for security middleware
- Add tests for atomic file operations
- Add tests for backup system

📚 DOCUMENTATION:
- Issue #80: Enhance .env.example with all configuration
- Issue #95: Create comprehensive technical debt resolution doc
- Document all new middleware and features
- Add deployment checklist and migration guide

FILES CREATED (14):
- backend/src/api/middleware/apiKeyAuth.js
- backend/src/api/middleware/payloadSizeLimit.js
- backend/src/api/middleware/websocketAuth.js
- backend/src/api/middleware/persistentRateLimit.js
- backend/src/api/middleware/prometheusMetrics.js
- backend/src/api/middleware/pagination.js
- backend/src/utils/atomicFileOperations.js
- backend/src/utils/databaseBackup.js
- backend/tests/api.test.js
- scripts/fix-console-logs.js
- TECHNICAL_DEBT_RESOLUTION.md

FILES MODIFIED (4):
- package.json: Move ffmpeg-static & puppeteer to optionalDependencies
- backend/src/server.js: Integrate all security middleware
- .env.example: Add comprehensive configuration variables

METRICS:
- Issues Resolved: 14/14 (100%)
- Security Features: 8
- Infrastructure Features: 6
- Test Coverage: Comprehensive
- Production Ready: ✅ YES

NEW ENDPOINTS:
- GET /health - Enhanced health check
- GET /metrics - Prometheus metrics

CONFIGURATION:
All features configurable via environment variables.
Security enforced in production, optional in development.

See TECHNICAL_DEBT_RESOLUTION.md for complete details.
@ryan-gray-db
Copy link

Additional Finding: Missing CLI Dependencies

While testing v1.3.3 after a fresh npm install -g @clduab11/gemini-flow, I encountered another issue not covered by this PR.

Problem

After installation, running gemini-flow --help fails with:

Failed to load fallback CLI: Cannot find package 'commander' imported from /path/to/gemini-flow/dist/cli/simple-index.js

Root Cause

The CLI requires commander, chalk, and ora packages, but these are not listed in package.json dependencies. They must be manually installed:

cd ~/.n/lib/node_modules/@clduab11/gemini-flow && npm install commander chalk ora

After this, gemini-flow --help works correctly.

Suggested Fix

Add these to dependencies in package.json:

"dependencies": {
  "commander": "^12.0.0",
  "chalk": "^5.3.0",
  "ora": "^8.0.0",
  // ... existing deps
}

This is separate from the file inclusion fixes in this PR but affects the same installation flow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: gemini extensions install and npm install -g fail for gemini-flow

3 participants