npm workspace missing module on install #123972
Replies: 2 comments
-
I figured this out; it was a version mismatch. We had:
which, can result in a version mismatch. A couple things:
So rather than notifying users of packages that aren't installed when using npm workspaces due to different versions being installed in different packages is one layer of obfuscation. The second is that the versions weren't actually mismatched, because the one specified in It would be great if npm logged errors when packages aren't installed, with helpful messaging. Would have saved me a day or two (and I'm sure others many, many more). |
Beta Was this translation helpful? Give feedback.
-
Hi @withinsight! Thanks so much for returning to the Community to share your solution! This will certainly help others who come across the same issue. I agree that extra logging would be useful, thanks for the product feedback as well! |
Beta Was this translation helpful? Give feedback.
-
I'm using npm workspaces for the first time, and I'm encountering something that feels like a bug. I have a single root
package.json
which lists my 5 packages (we'll call thempkg1
,pkg2
, etc.). Here's thedependency
setup between packages:pkg1
: nonepkg2
: nonepkg3
:pkg1
,pkg2
pkg4
:pkg1
,pkg2
,pkg3
pkg5
:pkg1
,pkg2
,pkg3
When I run
npm i
in the monorepo root, and review thenode_modules
folders for each package, everything installs properly, except for one dependency: thepkg3
dependency inpkg5
.It doesn't feel like a hoisting issue, as in my scoped folder in the root
node_modules
, all that exists are symlinks, which would indicate thatpkg5
isn't gettingpkg3
from anode_modules
further up as a phantom dependency.I tried running
npm install
with theinstall-strategy
set tonested
andlinked
, and nothing changes (indicating its not hoisting). I'm stuck because I can't figure out why npm would installpkg3
properly inpkg4
, but notpkg5
.Beta Was this translation helpful? Give feedback.
All reactions