<p>You'll have to change your dependency on <code>craftcms/generator</code> in your <code>composer.json</code> file to this (it's likely in the <code>require-dev</code> section):</p>
<pre class="lang-json prettyprint-override"><code>&quot;craftcms/generator&quot;: &quot;^2.0.0&quot;
</code></pre>
<p>Alternatively, if you don't actually use <a href="https://github.com/craftcms/generator" rel="nofollow noreferrer">Craft Generator</a>, you can remove the dependency altogether.</p>

CC BY-SA 4.0
2024-03-12T13:31:17.467Z
Thank you. That worked exactly as it should and I was able to complete the upgrade to version 5.x-beta.
flip
CC BY-SA 4.0
2024-03-12T09:53:56.120Z
2024-03-12T09:53:56.120Z
Mats Mikkel Rummelhoff
<p>For me, it looks like ... you have to uninstall the generator plugin at first?</p>

CC BY-SA 4.0
2024-03-12T13:33:12.587Z
I didn't want to delete it because it was delivered out-of-the box with Craft CMS. Requiring another version for the generator solved my issue.
flip
CC BY-SA 4.0
2024-03-12T09:12:34.350Z
2024-03-12T09:12:34.350Z
Marc 
<p>I followed the <a href="https://craftcms.com/docs/5.x/upgrade.html" rel="nofollow noreferrer">upgrade instructions</a>. My current version is 4.8.1. When I run <code>composer update</code>, I get the following error:
<a href="https://i.sstatic.net/nGZZT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nGZZT.png" alt="enter image description here" /></a></p>
<p>I added the following code to composer.json because of another issue:</p>
<pre><code>  &quot;minimum-stability&quot;: &quot;dev&quot;,
  &quot;prefer-stable&quot;: true,
</code></pre>
<p>How can I solve the error message to upgrade to 5.x?</p>

<updates><upgrades><craft5>
Upgrade to 5.x failed
# Upgrade to 5.x failed

(Asked by: username_0 on 2024-03-12)

I followed the upgrade instructions. My current version is 4.8.1. When I run composer update, I get the following error:

I added the following code to composer.json because of another issue:
  "minimum-stability": "dev",
  "prefer-stable": true,

How can I solve the error message to upgrade to 5.x?

**Tags:** updates, upgrades, craft5


---

## 2 answers

### Answer by username_1 on 2024-03-12. Score: 2 | Accepted answer

You'll have to change your dependency on craftcms/generator in your composer.json file to this (it's likely in the require-dev section):
"craftcms/generator": "^2.0.0"

Alternatively, if you don't actually use Craft Generator, you can remove the dependency altogether.

> **Comments:**
> **username_0**: Thank you. That worked exactly as it should and I was able to complete the upgrade to version 5.x-beta.  

---

### Answer by username_2 on 2024-03-12. Score: 0

For me, it looks like ... you have to uninstall the generator plugin at first?

> **Comments:**
> **username_0**: I didn't want to delete it because it was delivered out-of-the box with Craft CMS. Requiring another version for the generator solved my issue.  

---

