docs: add comment about why path.relative is used to compare paths

ref pnpm/pnpm#996
This commit is contained in:
Zoltan Kochan
2018-01-18 21:34:35 +02:00
parent 7336862ee5
commit 85bd4ee041

View File

@@ -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,