mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-30 17:52:25 -05:00
6
.changeset/few-dancers-exist.md
Normal file
6
.changeset/few-dancers-exist.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-rebuild": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
`pnpm rebuild` should not fail if node_modules was created by pnpm version 7.18 or older [#5815](https://github.com/pnpm/pnpm/issues/5815).
|
||||
6
.changeset/nervous-avocados-end.md
Normal file
6
.changeset/nervous-avocados-end.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-rebuild": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
`pnpm rebuild` should print a better error message when a hoisted dependency is not found [#5815](https://github.com/pnpm/pnpm/issues/5815).
|
||||
@@ -34,6 +34,7 @@
|
||||
"homepage": "https://github.com/pnpm/pnpm/blob/main/exec/plugin-commands-rebuild#readme",
|
||||
"devDependencies": {
|
||||
"@pnpm/assert-project": "workspace:*",
|
||||
"@pnpm/error": "workspace:*",
|
||||
"@pnpm/filter-workspace-packages": "workspace:*",
|
||||
"@pnpm/plugin-commands-rebuild": "workspace:*",
|
||||
"@pnpm/prepare": "workspace:*",
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
WANTED_LOCKFILE,
|
||||
} from '@pnpm/constants'
|
||||
import { skippedOptionalDependencyLogger } from '@pnpm/core-loggers'
|
||||
import { PnpmError } from '@pnpm/error'
|
||||
import { getContext, PnpmContext } from '@pnpm/get-context'
|
||||
import {
|
||||
runLifecycleHooksConcurrently,
|
||||
@@ -276,6 +277,11 @@ async function _rebuild (
|
||||
const pkgRoots = opts.nodeLinker === 'hoisted'
|
||||
? (ctx.modulesFile?.hoistedLocations?.[depPath] ?? []).map((hoistedLocation) => path.join(opts.lockfileDir, hoistedLocation))
|
||||
: [path.join(ctx.virtualStoreDir, dp.depPathToFilename(depPath), 'node_modules', pkgInfo.name)]
|
||||
if (pkgRoots.length === 0) {
|
||||
throw new PnpmError('MISSING_HOISTED_LOCATIONS', `${depPath} is not found in hoistedLocations inside node_modules/.modules.yaml`, {
|
||||
hint: 'If you installed your node_modules with pnpm older than v7.19.0, you may need to remove it and run "pnpm install"',
|
||||
})
|
||||
}
|
||||
const pkgRoot = pkgRoots[0]
|
||||
try {
|
||||
const extraBinPaths = ctx.extraBinPaths
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
{
|
||||
"path": "../../packages/dependency-path"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/error"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/types"
|
||||
},
|
||||
|
||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@@ -1046,6 +1046,9 @@ importers:
|
||||
'@pnpm/assert-project':
|
||||
specifier: workspace:*
|
||||
version: link:../../__utils__/assert-project
|
||||
'@pnpm/error':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/error
|
||||
'@pnpm/filter-workspace-packages':
|
||||
specifier: workspace:*
|
||||
version: link:../../workspace/filter-workspace-packages
|
||||
|
||||
Reference in New Issue
Block a user