Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cjholowatyj's avatar

PNPM Dependencies of Dependencies?

I thought it would be a great idea to refactor the dependencies of our client projects into the private npm package that I use to collect all the resources that all of our client projects use... (this way I don't have to manually update every project's package.json dependencies every time I update the core package). I'm starting to get super confused now though... Here's what I'm working with:

package.json file for my private @keddydigital/flighter npm package:

Within each project's package.json file I have:

"dependencies": {
	"@keddydigital/flighter": "^1.0.5"
}

Why is pnpm not installing all of the dependencies of my @keddydigital/flighter package, and if possible, how do I get it to do just that? (Ideally, I'd love for it to install all the Flighter packages from dependencies, and also the devDependencies whenever pnpm would normally install those for the root project as well)

THANKS IN ADVANCE FOR YOUR HELP!

0 likes
6 replies
gych's avatar

Which packages does it not install? Only the devdependecies or also some of dependencies?

cjholowatyj's avatar

My node_modules folder has the following after intall:

.bin
.pnpm
@eslint
@eslint-community
flighter
@keddydigital
eslint-patch
@rushstack
@typescript-eslint
@vue
eslint
eslint-config-prettier
eslint-import-resolver-typescript
eslint-module-utils
eslint-plugin-cypress
eslint-plugin-prettier
eslint-plugin-vue
eslint-scope
eslint-visitor-keys
prettier
prettier-linter-helpers
vue-eslint-parser
.modules.yaml
cjholowatyj's avatar

Conversely, when I run pnpm install within the package itself (not in the main repo), I get the following installed in the node_modules folder of the package:

cjholowatyj's avatar
cjholowatyj
OP
Best Answer
Level 9

Solved this issue by setting: hoist-workspace-packages=true in my .npmrc file

Please or to participate in this conversation.