map-workspaces icon indicating copy to clipboard operation
map-workspaces copied to clipboard

fix: workspaces run at root

Open reggi opened this issue 1 year ago • 1 comments

I was looking into https://github.com/npm/cli/issues/7563 where npm run -w packages/workspace doesn't work when the cwd is root / (docker issue).

Turns out it's because this returns false here https://github.com/npm/map-workspaces/blob/main/lib/index.js#L128

minimatch('/packages/workspace','packages/workspace', { partial: true, windowsPathsNoEscape: true })

I wish we could catch these. It is not possible to test this kind of code that uses cwd /.

reggi avatar Oct 09 '24 14:10 reggi

I wish we could catch these. It is not possible to test this kind of code that uses cwd /.

We don't "support" running out of root, and there are other issues where we've said that the kinds of bugs folks have from doing so won't be fixed. Running from / is a best-effort deal in npm, and it's possible we need better docs explaining this.

wraithgar avatar Oct 09 '24 15:10 wraithgar

We don't "support" running out of root, and there are other issues where we've said that the kinds of bugs folks have from doing so won't be fixed. Running from / is a best-effort deal in npm, and it's possible we need better docs explaining this.

Is this nonsupport documented anywhere? It'd be helpful to reference in an internal ticket to refactor some docker images we have.

jAg-upfort avatar Jan 09 '25 18:01 jAg-upfort