1

I have a main package.json for my project. I also have a component within my project which I'm publishing to NPM, so that requires its own package.json.

package.json
index.html
-folder
--component-folder
---package.json

Both package.json files define dependancies. At the moment I have to run npm install from both my project root and from component-folder. Is there a way of making it install dependancies for both when its only run from the project root?

Evanss
  • 20,529
  • 79
  • 252
  • 460
  • 1
    I think this is a similar enough issue? http://stackoverflow.com/questions/31773546/the-best-way-to-run-npm-install-for-nested-folders – julianljk Aug 09 '16 at 14:37
  • Similar: http://stackoverflow.com/questions/14381898/local-dependency-in-package-json – Evanss Aug 09 '16 at 15:19

1 Answers1

1

Try using subpackage. { "name": "my-awesome-project", "version": "2.5.1", "subPackages": [ "packages/sub-package-1", "packages/sub-package-2" ] } https://www.npmjs.com/package/subpackage