mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-23 09:31:52 -04:00
5
.changeset/silver-lions-repair.md
Normal file
5
.changeset/silver-lions-repair.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/global-bin-dir": patch
|
||||
---
|
||||
|
||||
`npx pnpm install --global pnpm` should not install pnpm to the temporary directory of npx.
|
||||
@@ -31,14 +31,14 @@ function pickBestGlobalBinDir (
|
||||
const noWriteAccessDirs = [] as string[]
|
||||
for (const dir of dirs) {
|
||||
const lowCaseDir = dir.toLowerCase()
|
||||
if (
|
||||
if ((
|
||||
isUnderDir('node', lowCaseDir) ||
|
||||
isUnderDir('nodejs', lowCaseDir) ||
|
||||
isUnderDir('npm', lowCaseDir) ||
|
||||
isUnderDir('pnpm', lowCaseDir) ||
|
||||
knownCandidates.some((candidate) => areDirsEqual(candidate, dir)) ||
|
||||
dirHasNodeRelatedCommand(dir)
|
||||
) {
|
||||
) && !isUnderDir('_npx', lowCaseDir)) {
|
||||
if (canWriteToDirAndExists(dir)) return dir
|
||||
noWriteAccessDirs.push(dir)
|
||||
}
|
||||
|
||||
@@ -41,10 +41,12 @@ const userGlobalBin = makePath('usr', 'local', 'bin')
|
||||
const nodeGlobalBin = makePath('home', 'z', '.nvs', 'node', '12.0.0', 'x64', 'bin')
|
||||
const npmGlobalBin = makePath('home', 'z', '.npm')
|
||||
const pnpmGlobalBin = makePath('home', 'z', '.pnpm')
|
||||
const npxGlobalBin = makePath('home', 'z', '.npm', '_npx', '123')
|
||||
const otherDir = makePath('some', 'dir')
|
||||
const currentExecDir = makePath('current', 'exec')
|
||||
const dirWithTrailingSlash = `${makePath('current', 'slash')}${path.sep}`
|
||||
process.env[FAKE_PATH] = [
|
||||
npxGlobalBin,
|
||||
userGlobalBin,
|
||||
nodeGlobalBin,
|
||||
npmGlobalBin,
|
||||
|
||||
Reference in New Issue
Block a user