mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-09 07:28:37 -05:00
fix(bin): don't add non-directory to NODE_PATH in command shim (#3240)
close #3156
This commit is contained in:
committed by
Zoltan Kochan
parent
dd12cf6ec0
commit
6350a33811
5
.changeset/many-oranges-rhyme.md
Normal file
5
.changeset/many-oranges-rhyme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/link-bins": patch
|
||||
---
|
||||
|
||||
Don't add a non-directory to the NODE_PATH declared in the command shim.
|
||||
@@ -175,11 +175,12 @@ async function linkBin (cmd: CommandInfo, binsDir: string) {
|
||||
}
|
||||
|
||||
async function getBinNodePaths (target: string): Promise<string[]> {
|
||||
const targetRealPath = await fs.realpath(target)
|
||||
const targetDir = path.dirname(target)
|
||||
const targetRealPath = await fs.realpath(targetDir)
|
||||
|
||||
return R.union(
|
||||
Module['_nodeModulePaths'](targetRealPath),
|
||||
Module['_nodeModulePaths'](target)
|
||||
Module['_nodeModulePaths'](targetDir)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user