3

Here is my structure:

Core
   \Project1
          package.json
Project2
    package.json

So I want from Core\Project1\package.json to link Project2\package.json to install its dependencies when I write npm install on Project1\package.json.

I tried npm 'Local Paths' answers from Local dependency in package.json but somehow it does not worked as expected:

when I type npm install ..\Project2\ -save it installs all the files from the project. But not the dependencies from the package.json files.

Community
  • 1
  • 1
MDB
  • 341
  • 3
  • 16

1 Answers1

-1

Here are two easy methods:

  1. Copy the dependencies of project1 package file into project 2's package file.

  2. Add project 1 as a dependency of project 2. If project 1 is a dependency of project 2 then all project 1's dependencies will automatically be pulled into project 2.

I understand that you want the dependencies of both projects to be updates with one run of the npm install command however that is not possible, and it is not much extra effort to call it once on both projects.

Adam Griffiths
  • 680
  • 6
  • 26
  • 60