From 85bd4ee041effbb32850a97b2aa82b61e3fcfee7 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Thu, 18 Jan 2018 21:34:35 +0200 Subject: [PATCH] docs: add comment about why path.relative is used to compare paths ref pnpm/pnpm#996 --- src/api/checkCompatibility.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/checkCompatibility.ts b/src/api/checkCompatibility.ts index 874d5a2308..16fef07b34 100644 --- a/src/api/checkCompatibility.ts +++ b/src/api/checkCompatibility.ts @@ -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,