skip to Main Content

I try to install Magento 2.4.5 through composer but showing an error "Could not find package project-community-edition with version 2.4.5."

I used cmd:composer create-project –repository-url=https://repo.magento.com/ project-community-edition:2.4.5 in the folder C:xampphtdocs in cmd.

following is my composer.jason file.

{
    "name": "mycompany/sample-module-minimal",
    "description": "A module that creates a page in the Magento admin area",
    "type": "magento2-module",
    "version": "2.4.5",
    "license": [
      "OSL-3.0",
      "AFL-3.0"
    ],
    "require": {
      "php": "~8.2.0"
    },
    "repositories": [
        {
            "type": "composer",
           "url": "https://repo.magento.com/"
       }
   ],
    "autoload": {
      "files": [ "registration.php" ],
      "psr-4": {
        "MyCompany\ExampleAdminNewPage\": ""
      }
    }
  }

2

Answers


  1. change your php version, 2.4.5 compatible with php 8.1
    see magento 2.4.5 requirement

    Login or Signup to reply.
  2. I’m not sure why you’ve got that composer file?

    That’s an example you’d use when creating a Magento module.

    Remove the composer file altogether, the composer create-project command should create a package for you, including a composer.json file.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search