npm / npm/cli

[BUG] bundledDependencies without its node modules

Open
#5,111 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Discussion Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior

I've changed from npm 6 to npm 8. I have a package that has a bundledDependency, when this package is installed in its dist folder the bundledDependency is bundled with its own node_modules.

When switching to npm 8 my CI started failing because when that package is used the bundledDependency doesnt have its node_modules and the dependencies it uses are not found

Screenshot 2022-06-30 at 16 28 57 Screenshot 2022-06-30 at 16 42 57

This leads to errors like this

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '@datadog/datadog-api-client'
Require stack:

Open as a bug but not sure if this is intended behaviour and i need some kind of flag. through the documentation have not found anything related to this

Expected Behavior

No response

Steps To Reproduce
  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...
Environment
  • npm: 8.12.1
  • Node.js: 16.15.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or concrete reproduction project are named. Start by reproducing the bundled dependency installation with npm 8.12.1 and Node.js 16.15.0, then inspect the resulting package and the missing @datadog/datadog-api-client error. Done means determining whether nested node_modules are expected and documenting or correcting the behavior with a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.