microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.83k stars 592 forks source link

[rush] rush update will not remove rush dependencies from node_modules when using yarn #1407

Open davazp opened 5 years ago

davazp commented 5 years ago

Is this a feature or a bug?

Please describe the actual behavior. When I remove one of dependencies from a package.json and run rush update, the symbolic link under node_modules remains when using yarn, but it is removed when using pnpm or npm.

If the issue is a bug, how can we reproduce it? Please provide detailed steps and include a GitHub branch if applicable. Your issue will get resolved faster if you can make it easy to investigate.

You can replicate it with the example repository.

  1. Clone my fork: git clone https://github.com/davazp/rush-example.git this is just modified to use yarn.

  2. Run rush update

  3. List symbolic links of a package:

    $ ls -l libraries/my-controls/node_modules/
    total 0
    lrwxr-xr-x  1 davazp  staff    27B Jul 21 18:50 my-toolchain -> ../../../tools/my-toolchain
    lrwxr-xr-x  1 davazp  staff    44B Jul 21 18:50 typescript -> ../../../common/temp/node_modules/typescript
  4. Delete the dependency to my-tooling from libraries/my-controls/package.json.

  5. Re-run rush update

  6. List symbolic links again as above. The symbolic link is still there.

What is the expected behavior? rush rush should remove the symbolic link as it does with the other tools.

If this is a bug, please provide the tool version, Node.js version, and OS.

the-constant commented 3 years ago

Hi, I'm having the same issues. Node version 12.10.0.

I have to use yarn because electron-packager doesn't play nice with pnpm dependencies

MichaelBelousov commented 3 years ago

just to add, I am working on a fix in a fork of a dependency of electron-packager, https://github.com/MichaelBelousov/flora-colossus/tree/work-with-pnpm, with the goal to upstream it. It would begin the work to let pnpm be used by electron-packager, by resolving dependencies correctly.

EDIT: I should make a separate issue for this comment, maybe better in electron-forge's repo #2670. My fork only demonstrates somewhat how to make that particular package work, electron-packager can succeed now, but copied dependencies still are incorrect, because the copy code in electron-packager is not aware of how pnpm should work either