Skip to content

npm install -g from a github: URL fails — nested git deps prepared without node_modules #25

Description

@skansal-rome

Symptom. The README's former primary install path fails on npm 11 / node 24 (and the npx cache path is unaffected):

npm install -g github:rome-protocol/rome-cli#v0.8.0
npm error command sh -c npm run build
npm error src/bin.ts(4,6): error TS2591: Cannot find name 'process'. …
npm error error TS2307: Cannot find module 'viem' / 'zod' / '@modelcontextprotocol/sdk/server/stdio.js' …

Installing a packed tarball globally fails the same way, one level deeper:

npm error git dep preparation failed
npm error command sh -c npm run build        # @rome-protocol/sdk 0.2.1 prepare
npm error src/cpi.ts(1,68): error TS2307: Cannot find module 'viem' …

Cause. During a global install, npm prepares github: dependencies (this package itself, and its @rome-protocol/sdk / @rome-protocol/registry git deps) by running their preparetsc in a temp clone without installing that clone's own dependencies first, so the compile sees an empty node_modules. Non-global contexts (npx one-shot, npm install in a clone) prepare correctly.

What works today (README updated in #24):

  • npx github:rome-protocol/rome-cli … — one-shot
  • git clone … && npm install && npm install -g . — durable install

Real fix. Publish @rome-protocol/cli, @rome-protocol/sdk, and @rome-protocol/registry to the npm registry — published tarballs ship built dist/ and need no prepare step, which removes the git-dep preparation path entirely. (Publishing the CLI alone is not enough: its git deps still trigger preparation.) Interim alternative if publish stays blocked: commit dist/ to the tagged releases or attach release tarballs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions