Skip to content

Conversation

@gwleuverink
Copy link
Collaborator

@gwleuverink gwleuverink commented Oct 28, 2025

This PR fixes the yarn installer.
Additionally it now throws an error when a install, run or build command fails, no longer failing silently.

  • Removed packageManagers entry from package.json
    This should not be included since we support multiple package managers
    Fixes Run the NativePHP installer with pnpm doesn't work. #29

  • Removed yarn.lock
    Was very old and out of date. Will ensure outdated lock file is not used when using yarn as the installer

  • Throw when a process in ExecuteCommand.php fails

  • Removed some debug logs

This should not be included since we support multiple package managers
@gwleuverink gwleuverink changed the title removed packageManagers from package.json removed packageManager from package.json Oct 28, 2025
@gwleuverink gwleuverink self-assigned this Oct 28, 2025
@gwleuverink gwleuverink changed the title removed packageManager from package.json improve yarn/npm installers Nov 4, 2025
No need to throw, PHP trace won't give any relevant output here. Just make clear what process failed. Error output is already echoed above.

ensureDirSync(binaryDestDir);

console.log('FOOOOO')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol. 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know 🫠 haha

if ($result->failed()) {
echo PHP_EOL;
error("Command failed: '{$command}' (exit code {$result->exitCode()})");
exit();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include the exit code here in the parenthesis to ensure we don’t return exit 0 (success)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7ed3679

@gwleuverink
Copy link
Collaborator Author

Need one more review on this one @NativePHP/contributors

@PeteBishwhip
Copy link
Member

Got chu.

@gwleuverink gwleuverink merged commit 8f636d7 into main Nov 6, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run the NativePHP installer with pnpm doesn't work.

4 participants