diff --git a/packages/config/src/index.ts b/packages/config/src/index.ts index 982ba55c85..12c1652150 100644 --- a/packages/config/src/index.ts +++ b/packages/config/src/index.ts @@ -267,7 +267,7 @@ export default async ( if (pnpmConfig['globalDir']) { globalDirRoot = pnpmConfig['globalDir'] } else { - globalDirRoot = path.join(pnpmConfig.pnpmHomeDir, 'global-packages') + globalDirRoot = path.join(pnpmConfig.pnpmHomeDir, 'global') } pnpmConfig.dir = path.join(globalDirRoot, LAYOUT_VERSION.toString()) @@ -317,7 +317,7 @@ export default async ( throw new PnpmError('CONFIG_CONFLICT_VIRTUAL_STORE_DIR_WITH_GLOBAL', 'Configuration conflict. "virtual-store-dir" may not be used with "global"') } - delete pnpmConfig.virtualStoreDir + pnpmConfig.virtualStoreDir = '.pnpm' } else { pnpmConfig.dir = cwd pnpmConfig.bin = path.join(pnpmConfig.dir, 'node_modules', '.bin') diff --git a/packages/pnpm/test/install/global.ts b/packages/pnpm/test/install/global.ts index 53f8b1b4ef..013f7d2a50 100644 --- a/packages/pnpm/test/install/global.ts +++ b/packages/pnpm/test/install/global.ts @@ -24,7 +24,7 @@ test('global installation', async () => { // https://github.com/pnpm/pnpm/issues/808 await execPnpm(['install', '--global', 'is-negative'], { env }) - const globalPrefix = path.join(global, `pnpm/global-packages/${LAYOUT_VERSION}`) + const globalPrefix = path.join(global, `pnpm/global/${LAYOUT_VERSION}`) const { default: isPositive } = await import(path.join(globalPrefix, 'node_modules', 'is-positive')) expect(typeof isPositive).toBe('function') @@ -58,7 +58,7 @@ test('always install latest when doing global installation without spec', async await execPnpm(['install', '-g', 'peer-c@1'], { env }) await execPnpm(['install', '-g', 'peer-c'], { env }) - const globalPrefix = path.join(global, `pnpm/global-packages/${LAYOUT_VERSION}`) + const globalPrefix = path.join(global, `pnpm/global/${LAYOUT_VERSION}`) process.chdir(globalPrefix) @@ -85,5 +85,5 @@ test('run lifecycle events of global packages in correct working directory', asy await execPnpm(['install', '-g', 'postinstall-calls-pnpm@1.0.0'], { env }) - expect(await exists(path.join(global, `pnpm/global-packages/${LAYOUT_VERSION}/node_modules/postinstall-calls-pnpm/created-by-postinstall`))).toBeTruthy() + expect(await exists(path.join(global, `pnpm/global/${LAYOUT_VERSION}/node_modules/postinstall-calls-pnpm/created-by-postinstall`))).toBeTruthy() }) diff --git a/packages/pnpm/test/root.ts b/packages/pnpm/test/root.ts index 4458a2840c..37350cac9a 100644 --- a/packages/pnpm/test/root.ts +++ b/packages/pnpm/test/root.ts @@ -28,5 +28,5 @@ test('pnpm root -g', async () => { const result = execPnpmSync(['root', '-g'], { env }) expect(result.status).toBe(0) - expect(result.stdout.toString()).toBe(path.join(global, `pnpm/global-packages/${LAYOUT_VERSION}/node_modules`) + '\n') + expect(result.stdout.toString()).toBe(path.join(global, `pnpm/global/${LAYOUT_VERSION}/node_modules`) + '\n') })