# Mautic Composer Update to 5.2.6 fails with npx patch-package Unexpected token

**URL:** <https://forum.mautic.org/t/mautic-composer-update-to-5-2-6-fails-with-npx-patch-package-unexpected-token/35736>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [May 27, 2025, 7:46pm UTC](https://forum.mautic.org/t/mautic-composer-update-to-5-2-6-fails-with-npx-patch-package-unexpected-token/35736 "2025-05-27T19:46:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stemautic88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stemautic88/32/690_2.png) [@stemautic88](https://forum.mautic.org/u/stemautic88)\
**Post date:** [May 27, 2025, 7:46pm UTC](https://forum.mautic.org/t/mautic-composer-update-to-5-2-6-fails-with-npx-patch-package-unexpected-token/35736/1 "2025-05-27T19:46:46Z")

</div>

**Your software**  
My Mautic version is: Updating to 5.2.6  
My PHP version is: 8.1.32  
My Database type and version is: MySQL 8.0.42

**Your problem**  
My problem is:

Updating with composer works until npx patch-package comes up. Then it fails.

Error Message:

npx patch-package  
Unexpected token .  
Script npx patch-package handling the npx-patch-package event returned with error code 1  
Script @npx-patch-package was called via post-update-cmd

These errors are showing in the log:

No entries in log file.

Steps I have tried to fix the problem:

- Checked the npm module versions with the package.json of Mautic and all are okay.
- reinstalled patch-package
- updated composer
- updated node to v22.16.0 and npm to 10.9.2
- tried different node.js versions, but issue persists.
- checked JSON files for format errors =\> nothing found.
- run npm audit and npm audit fix, but did not change anything.
- tried some bin/console commands, but nothing changed anything.

Last time, it worked to use the latest node.js version. But this time it does not even work with the latest version.

Any idea about how to get the update to finish are welcome.

Thanks!

---

<div class="post-metadata">

**Author:** ![stemautic88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stemautic88/32/690_2.png) [@stemautic88](https://forum.mautic.org/u/stemautic88)\
**Post date:** [May 28, 2025, 10:11am UTC](https://forum.mautic.org/t/mautic-composer-update-to-5-2-6-fails-with-npx-patch-package-unexpected-token/35736/2 "2025-05-28T10:11:31Z")

</div>

As I don’t have a solution for now, I rolled back to version 5.2.3.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [May 29, 2025, 10:11pm UTC](https://forum.mautic.org/t/mautic-composer-update-to-5-2-6-fails-with-npx-patch-package-unexpected-token/35736/3 "2025-05-29T22:11:49Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
