pnpm creates invalid symlinks

Created on 9 Oct 2020  路  4Comments  路  Source: pnpm/pnpm

Creating this issue as requested by @zkochan on discord.

pnpm version:

$ pnpm --version
5.8.0

Code to reproduce the issue:

https://github.com/mtford90/timberwolf/tree/try-pnpm

git clone https://github.com/mtford90/timberwolf.git
cd timberwolf
git checkout try-pnpm
pnpm install
ls node_modules # observe broken symlinks.

Expected behavior:

There should be no invalid symlinks

Actual behavior:

Symlinks are pointing to nowhere.

Additional information:

  • node -v prints: v14.7.0
  • Windows, OS X, or Linux?: macOS Catalina 10.15.6
bug

Most helpful comment

:ship: 5.13.7

All 4 comments

I see, so these are optional dependencies that are skipped. Hoisting still creates the symlinks to them even though they are not installed.

We should fix this probably but I don't think it is a high priority as those packages should not be installed and everything should be functional even with a few broken symlinks inside node_modules.

@zkochan ah, this must be a naughty package then...

if you try pnpm run rebuild:electron it will fail due to missing async-each which indicates these dependencies should not in fact be optional.

We have exactly the same issue with invalid symlinks affecting us in multiple ways.

See for example that bug (which is a bug in azure task I think so I've submitted it there, but still won't occur if pnpm won't create invalid symlink): https://github.com/microsoft/azure-pipelines-tasks/issues/13688

Another similar issue we have with SonarQube which also scans everything and crashes on invalid symlink.

Of course those tools may just not fail when spotting invalid symlink, but they do and here's a simple and centralized solution - don't create them.

:ship: 5.13.7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vjpr picture vjpr  路  5Comments

Dmitry-N-Medvedev picture Dmitry-N-Medvedev  路  4Comments

aleclarson picture aleclarson  路  4Comments

fbutter picture fbutter  路  4Comments

jsumners picture jsumners  路  3Comments