hnvm
hnvm copied to clipboard
Package postinstall step fails when spawning new node process
Output when running ./pnpm install
in a project with [email protected]
:
node_modules/.pnpm/[email protected]/node_modules/core-js-pure: Running postinstall script, failed in 935ms
.../node_modules/core-js-pure postinstall$ node -e "try{require('./postinstall')}catch(e){}"
│ No HNVM_NODE version set. Please set a Node version.
└─ Failed in 936ms
The error occurs when the package is running this postinstall step defined in its package.json
.
original report in slack: https://compass-tech.slack.com/archives/CBN9MNRHD/p1639153650353500
Per discussion in that thread, this issue is only occurring with pnpm >= 6.23.0, which made this change:
The path to the node executable that executes pnpm should not be added to the PATH, when running scripts.
Adding scripts-prepend-node-path=true
to the project's .npmrc
restores the more hnvm-friendly behavior that we had with older pnpm versions.