Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx-v19.1.2 : Library specific dependencies are not copied\automatically inferred from main package.json #29683

Open
1 of 4 tasks
CCT-Mukund-Thakare opened this issue Jan 20, 2025 · 0 comments

Comments

@CCT-Mukund-Thakare
Copy link

Current Behavior

We have upgraded NX from Nx-v15.6 to Nx-v19.1 and we have started facing an issue of not copying dependencies from main package.json into individual library package json.

Our monoRepo folder directory looks like this.

MonoRepo_folder
--- Library_folder
----- Library_1
------- src
------- Package.json_1
----- Library_2
------- src
------- Package.json_2
----- Library_3
------- src
------- Package.json_3
---Package.json_Main

As we can see in above folder structure
Inside single Monorepo we have 3 sub-modules\library (Library_1, Library_2, Library_3) each having individual package.json And Main Package.json in the root directory.

Package.json_Main have all dependencies, devDependencies and peer-dependencies which are used by Library_1, Library_2, Library_3.
So individual package.json that is Package.json_1, Package.json_2 and Package.json_3 does not have any dependencies.

On building this monorepo with Nx-v15, NX was automatically inferring and copying the relevant dependencies of the libraries (Library_1, Library_2, Library_3) in their own separate package.json (Package.json_1, Package.json_2 and Package.json_3 ) files from Package.json_Main.

But after upgrade to Nx-v19, NX is not automatically inferring and copying the relevant dependencies of the libraries,
There are no dependencies in the library specific package.json files.

We want to have the dependencies copied in the specific package.json from Pacakge.json_Main.
So that when we share the individual library_1, library_2, library_3 code all of it's dependencies should be installed with npm install command.

How can we copy these dependencies with Nx-v19 ?

Expected Behavior

We want to have the dependencies copied in the specific package.json from Pacakge.json_Main.
So that when we share the individual library_1, library_2, library_3 code all of it's dependencies should be installed with npm install command.

GitHub Repo

No response

Steps to Reproduce

  1. Build the Mono repo
  2. check individual library package.json

Nx Report

NA

Failure Logs

Package Manager Version

node Version 20.17.0, npm version 11.0.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants