4

Many of the same questions have been asked before link, but none give a solid answer or are very outdated, so just asking again.

I have a package.json with a local npm module:

{
  "dependencies": {
    "local_module": "file:..pathtomodule"
  }
}

when i run npm i for the host package, the local module is installed, but modules from the local_module are not installed. So I have to run a separate npm i for the local_module.

What am i doing wrong?? isn't it just a module??

p.s. why am i getting minus for the question? please explain so I can improve

thanks in advance

DutchKevv
  • 1,659
  • 2
  • 22
  • 39

1 Answers1

1

What I use to do in that case is to "force" dependencies to be "npm installed" using preinstall script in the root module:

   {
      "dependencies": {
        "local_module": "file:..pathtomodule"
      },
      "scripts": {
        "preinstall": "npm install ..pathtomodule"
      }
    }