---
title: "Cannot declare class ComposerAutoloaderInitDrupal"
date: "2025-03-26T04:23:27+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/93906-cannot-declare-class-composerautoloaderinitdrupal"
id: "3199fb0d-bf91-4de6-acce-9e0ce21441a7"
---

If you modified the composer.json that comes with Drupal and then moved it above the docroot, you may see the following error when attempting to run Drush commands:

    Error: Cannot declare class ComposerAutoloaderInitDrupal, because the name is already in use in /mnt/www/html/<site_name>/docroot/vendor/composer/autoload_real.php, line 5

This is a result of the following line that is added to docroot/vendor/autoload.php as well as the vendor/autoload.php that exists above the docroot.

    return ComposerAutoloaderInitDrupal::getLoader();

You'll need to remove the following from your composer.json file:

    "autoloader-suffix": "Drupal"

You should then delete the composer.lock and vendor directory that exist above the docroot and rebuild them with:

    rm -rf vendor composer.lock 
    composer update --lock