mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-08 15:08:27 -05:00
5
.changeset/red-tools-thank.md
Normal file
5
.changeset/red-tools-thank.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/link-bins": patch
|
||||
---
|
||||
|
||||
When creating command shims, add the parent node_modules directory of the `.bin` directory to the NODE_PATH.
|
||||
@@ -159,7 +159,11 @@ async function linkBin (cmd: Command, binsDir: string) {
|
||||
if (EXECUTABLE_SHEBANG_SUPPORTED) {
|
||||
await fs.chmod(cmd.path, 0o755)
|
||||
}
|
||||
const nodePath = await getBinNodePaths(cmd.path)
|
||||
let nodePath = await getBinNodePaths(cmd.path)
|
||||
const binsParentDir = path.dirname(binsDir)
|
||||
if (path.relative(cmd.path, binsParentDir) !== '') {
|
||||
nodePath = R.union(nodePath, await getBinNodePaths(binsParentDir))
|
||||
}
|
||||
return cmdShim(cmd.path, externalBinPath, {
|
||||
createPwshFile: POWER_SHELL_IS_SUPPORTED,
|
||||
nodePath,
|
||||
|
||||
Reference in New Issue
Block a user