pnpm: `pnpm` does not update `node_modules` when `node-linker=hoisted`
It seems that pnpm always run --lockfile-only=true when node-linker=hoisted.
pnpm version: 6.32.11
Code to reproduce the issue:
- Create a
.npmrc, addnode-linker=hoistedin any existing project. pnpm iwith any existingpackage.jsonto build thenode_modulesfolder.- Add any new package, i.e.
pnpm add nx
Expected behavior:
pnpm add / pnpm up should update the node_modules folder
Actual behavior:
The following warning popups when pnpm add or pnpm up is run
WARN `node_modules` is present. Lockfile only installation will make it out-of-date
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 15
- Comments: 21 (3 by maintainers)
I’m getting this issue as well.
It seems to work fine. The warning should not be printed.
I don’t get it how the comments are related to this issue. The issue is about a warning message which should not be printed.
This is the correct behaviour for
node-linker=hoisted. pnpm updates the lockfile then it hoists the packages using info from the lockfiles. Lastly, it checks what is in the filesystem inside node_modules and makes changes if they are required.If you have issues with
node-linker=hoisted, stope commenting in this issue. Create a new issue with steps to reproduce.OK, if you can create exact steps to reproduce, we can check.
Adding this to
.npmrcfixed the issue for me:how to solve this? trying to use workspaces and I have no clue why on earth this warning pops up upon a simple pnpm add 😵💫🔫
Same issue here. It started happening after setting
node-linkertohoisted. Any way to avoid a complete reinstall of all paclages when only one package is added? Why exactly does it do that?