Commit c24da67
committed
fix: resolve symlinks in launcher script for npm global install
The shell launcher used ${0%/*} to find its lib/ directory, but when
npm installs globally it creates a symlink in the bin dir. ${0%/*}
resolves to the npm bin dir, not the package dir, causing:
Cannot find module '.../lib/hyperagent-launcher.cjs'
Use readlink -f / realpath to resolve symlinks before computing the
relative path to the lib directory.
Tested: symlink from /tmp/ → prints version correctly; old approach
confirmed to fail with MODULE_NOT_FOUND.
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>1 parent 8cdb5c7 commit c24da67
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
| |||
0 commit comments