mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-25 16:18:06 -05:00
6
.changeset/silent-onions-design.md
Normal file
6
.changeset/silent-onions-design.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-installation": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
`pnpm update --global --latest` should work [#3779](https://github.com/pnpm/pnpm/issues/3779).
|
||||
@@ -48,6 +48,7 @@ export type InstallDepsOptions = Pick<Config,
|
||||
| 'global'
|
||||
| 'globalPnpmfile'
|
||||
| 'hooks'
|
||||
| 'ignoreCurrentPrefs'
|
||||
| 'ignorePnpmfile'
|
||||
| 'ignoreScripts'
|
||||
| 'linkWorkspacePackages'
|
||||
|
||||
@@ -267,6 +267,7 @@ async function update (
|
||||
...opts,
|
||||
allowNew: false,
|
||||
depth,
|
||||
ignoreCurrentPrefs: false,
|
||||
includeDirect,
|
||||
include,
|
||||
update: true,
|
||||
|
||||
@@ -86,3 +86,20 @@ test('run lifecycle events of global packages in correct working directory', asy
|
||||
|
||||
expect(await exists(path.join(global, `pnpm/global/${LAYOUT_VERSION}/node_modules/@pnpm.e2e/postinstall-calls-pnpm/created-by-postinstall`))).toBeTruthy()
|
||||
})
|
||||
|
||||
test('global update to latest', async () => {
|
||||
prepare()
|
||||
const global = path.resolve('..', 'global')
|
||||
const pnpmHome = path.join(global, 'pnpm')
|
||||
fs.mkdirSync(global)
|
||||
|
||||
const env = { [PATH_NAME]: pnpmHome, PNPM_HOME: pnpmHome, XDG_DATA_HOME: global }
|
||||
|
||||
await execPnpm(['install', '--global', 'is-positive@1'], { env })
|
||||
await execPnpm(['update', '--global', '--latest'], { env })
|
||||
|
||||
const globalPrefix = path.join(global, `pnpm/global/${LAYOUT_VERSION}`)
|
||||
|
||||
const { default: isPositive } = await import(path.join(globalPrefix, 'node_modules/is-positive/package.json'))
|
||||
expect(isPositive.version).toBe('3.1.0')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user