mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-27 19:41:44 -04:00
fs.realpathSync uses a JS-only implementation that only resolves symlinks, not Windows 8.3 short names (e.g., RUNNER~1). Switch to fs.promises.realpath which uses the native uv_fs_realpath (GetFinalPathNameByHandleW on Windows) to properly resolve 8.3 short paths to their long form.
@pnpm/link-bins
Link bins to node_modules/.bin
Installation
pnpm add @pnpm/link-bins
Usage
import linkBins, {linkBinsOfPackages} from '@pnpm/link-bins'
function warn (msg) { console.warn(msg) }
await linkBins('node_modules', 'node_modules/.bin', {warn})
const packages = [{manifest: packageJson, location: pathToPackage}]
await linkBinsOfPackages(packages, 'node_modules/.bin', {warn})