Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ async function fixGlobalInstallBin() {
* Replace the symlink to the JS wrapper with a symlink to the native binary.
*/
async function fixUnixSymlink() {
// Skip optimization in Volta environment - Volta uses a staging directory
// that gets renamed after postinstall, breaking absolute symlinks
if (process.env.VOLTA_HOME) {
console.log('ℹ Volta detected: skipping bin optimization (Volta manages shims)');
return;
}

// Get npm's global bin directory (npm prefix -g + /bin)
let npmBinDir;
try {
Expand Down Expand Up @@ -187,6 +194,13 @@ async function fixUnixSymlink() {
* We overwrite them to invoke the native .exe directly.
*/
async function fixWindowsShims() {
// Skip optimization in Volta environment - Volta uses a staging directory
// that gets renamed after postinstall, breaking absolute symlinks
if (process.env.VOLTA_HOME) {
console.log('ℹ Volta detected: skipping bin optimization (Volta manages shims)');
return;
}

// Check if this is a global install by looking for npm's global prefix
let npmBinDir;
try {
Expand Down