npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

How can I install the development dependencies of a package into the root of my project?

My folder structure looks like this:


I run recursive installs in my package prepublish hook (so it runs right after installs) to install the dependencies within the another_package folder, but I need to also install all the packages from another_package/package.json into the root node_modules folder.

I can run npm install another_package and it’ll install the dependencies into the main node_modules folder, but it won’t install the development dependencies which I also need. I’ve tried using the --only=dev and the --dev flags, and they don’t have an effect.

Any ideas?