You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For anyone using an older npm workspace configuration (maybe only on windows), replace the \\ slashes with / fixes the Issue.
The text was updated successfully, but these errors were encountered:
boeckMt
changed the title
Get package json files patterns - paths not normalized with older npm version
syncpack list-mismatches not finding package json files
Apr 7, 2023
JamieMason
changed the title
syncpack list-mismatches not finding package json files
handling windows paths found in package manager configuration
May 11, 2023
JamieMason
changed the title
handling windows paths found in package manager configuration
feat(config): normalise windows workspace paths
May 28, 2023
Description
Get package json files patterns - paths not normalized with older npm version
Version of syncpack: 9.8.4
OS: Windows
Package Manager: NPM
I have the following root package.json in a monorepo
workspaces are added through the commands (It was with an older npm version 7.24.2)
npm init -w ./projects/app/<name>
ornpm init -w ./projects/libs/<name>
this added the
\\
slashes somehow, this is reproducible withnpm i npm@7.24.2 -g
With a more current npm version 9.5.1 this is not happening anymore, than its like
With the old workspaces config patterns are not matched and therefore no package.json files are found.
E.g. in get-file-paths.ts, then the pattern looks something like
projects\libs\lib1/package.json
syncpack/src/get-context/get-package-json-files/get-file-paths.ts
Line 38 in 2f1ffba
Suggested Solution
replace slashes in patterns
pattern = pattern.replace(/\\/g, '/');
syncpack/src/lib/disk.ts
Lines 39 to 41 in 2f1ffba
Workaround
For anyone using an older npm workspace configuration (maybe only on windows), replace the
\\
slashes with/
fixes the Issue.The text was updated successfully, but these errors were encountered: