Skip to content

Dependencies don't seem to install correctly with npm workspaces (regression from v9.x) #922

@codenomnom

Description

@codenomnom

Initial checklist

Affected package

[email protected]

Steps to reproduce

Problem: When installing [email protected] in an npm workspace (monorepo), the package's regular dependencies are not being installed, causing build failures with "Module not found" errors for packages like hast-util-to-jsx-runtime, html-url-attributes, unified, etc.

This is a regression - [email protected] works perfectly fine in the same setup. Tested with forcefully cleaning npm modules and cache.

Comparison Test:

Workaround: Installing with npm install [email protected] --legacy-peer-deps correctly installs all dependencies.

I might be completely missing something out, or it might be a local issue, but I've just spent the last few hours digging into this, and it seems to really not work when upgrading (and it does when downgrading).

Steps to Reproduce:

  1. Create an npm workspace setup
  2. Install [email protected] using npm install react-markdown --workspace=@workspace/name
  3. Try to build/import react-markdown
  4. See "Module not found" errors for dependencies

Actual behavior

Regular dependencies like hast-util-to-jsx-runtime, html-url-attributes, unified, etc. are missing from node_modules, causing module resolution failures.

Expected behavior

All dependencies listed in react-markdown's package.json should be automatically installed (like in v9.x).

Runtime

[email protected]

Package manager

[email protected]

Operating system

Windows

Build and bundle tools

Next.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🤷 no/invalidThis cannot be acted upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions