Repository navigation
[rush] All node_modules/.bin point to the common .bin which precludes different packages with different bin versions #915
Description
Activity
- changed the title
[-]All `node_modules/.bin` point to the common .bin which precludes different packages with different bin versions[/-][+][rush] All `node_modules/.bin` point to the common .bin which precludes different packages with different bin versions[/+]on Oct 30, 2018 Which package manager are you using? For PNPM it seems like we link to the local .bin folder:
// Also symlink the ".bin" folder const projectFolder: string = path.join(localPackage.folderPath, 'node_modules'); const projectBinFolder: string = path.join(localPackage.folderPath, 'node_modules', '.bin'); // Return type is Promise<void[]> because the API returns Promise.all() return pnpmLinkBins(projectFolder, projectBinFolder) .then(() => { /* empty block */ });
- npm or yarn exhibit this behavior.…On Tue, Oct 30, 2018 at 11:02 PM Pete Gonzalez ***@***.***> wrote: Which package manager are you using? For PNPM it seems like we link to the local *.bin* folder: PnpmLinkManager.ts <https://github.com/Microsoft/web-build-tools/blob/master/apps/rush-lib/src/logic/pnpm/PnpmLinkManager.ts#L214> // Also symlink the ".bin" folder const projectFolder: string = path.join(localPackage.folderPath, 'node_modules'); const projectBinFolder: string = path.join(localPackage.folderPath, 'node_modules', '.bin'); // Return type is Promise<void[]> because the API returns Promise.all() return pnpmLinkBins(projectFolder, projectBinFolder) .then(() => { /* empty block */ }); — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#915 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAYnRL9O-lkcAvu-ViFjqI4b8fAwAn4aks5uqL5jgaJpZM4YAZ3P> .-- Yours, Gil
- addedbugSomething isn't working as intendedSomething isn't working as intendedhelp wantedIf you're looking to contribute, this issue is a good place to start!If you're looking to contribute, this issue is a good place to start!effort: easyProbably a quick fix. Want to contribute? :-)Probably a quick fix. Want to contribute? :-)
on Oct 31, 2018 npm or yarn exhibit this behavior.
I see. We should definitely fix their code paths to look like PnpmLinkManager.ts. NPM and Yarn both use the same file NpmLinkManager.ts, so this should be a pretty easy fix.
PR made for this: #1256
Does this also cover the issue where if a rush-managed project inside the monorepo has a bin command then it does not get linked into other projects that depend on it?
EDIT: Found it, this is the issue that talks about that specifically, in which Christian Gonzalez (@christiango) mentiones the same pull request: #1100
Christian Gonzalez (@christiango) Any plans for that pull request?
At the moment, I have a script that I run after
rush update:# fix-stuff.sh # make sure the builder binary is linked. Rush does not link binaries of # projects currently. See https://github.com/microsoft/rushstack/issues/915 ln -sf ../../../../packages/FormidableLabs+builder/bin/builder.js common/temp/node_modules/.bin/builder ...
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsHigh priority
If I have package
awith mocha v4, and packagebwith mocha v5, then both packageaandbwill have anode_modules/.bin, but they both symlink tocommon/temp/node_modules/.bin, so the commandmochain an npm script will either point to mocha v4 or mocha v5.I'm not sure why each package has to symlink to the common
node_modules/.bin(or why there even needs to be such a common bin). It seems that it is not consistent.It seems that each package should have a local
node_modules/.bin, just as it does in regular npm installs.(BTW, this happens when package manager is yarn or npm. I couldn't get pnpm working with my stuff)