Skip to content

Unable to publish package with bare npm: specifier in monorepo #1185

@teneplaysofficial

Description

@teneplaysofficial

I’m trying to publish a package from a monorepo to JSR, but the publish step fails when one package depends on another internal package that’s published to npm.

Example:

import kolory  from "npm:kolory";

When I run npx jsr publish, I get:

Publishing @tene/ansilory@2.0.0 ...
error: Failed to publish @tene/ansilory@2.0.0

Caused by:
    Failed to publish @tene/ansilory at 2.0.0: specifier 'npm:kolory' is missing a version constraint

Context

  • Monorepo managed with pnpm
  • kolory is another package in the same repo, already published to npm
  • ansilory depends on it
  • For local dev we use workspace linking (workspace:*), but JSR doesn’t seem to support that.

Question

Is there a way to publish a JSR package that depends on another npm package without hardcoding a version in the npm: specifier?

Or, is the only option to:

  • Add an explicit version (npm:kolory@^1.0.0), or
  • Publish both packages to JSR and switch to jsr: imports?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions