mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-25 18:41:48 -04:00
docs: add comment about why path.relative is used to compare paths
ref pnpm/pnpm#996
This commit is contained in:
@@ -67,6 +67,10 @@ export default function checkCompatibility (
|
||||
modulesPath: string,
|
||||
}
|
||||
) {
|
||||
// Important: comparing paths with path.relative()
|
||||
// is the only way to compare paths correctly on Windows
|
||||
// as of Node.js 4-9
|
||||
// See related issue: https://github.com/pnpm/pnpm/issues/996
|
||||
if (path.relative(modules.store, opts.storePath) !== '') {
|
||||
throw new UnexpectedStoreError({
|
||||
expectedStorePath: modules.store,
|
||||
|
||||
Reference in New Issue
Block a user