diff --git a/simple_fb_connect.install b/simple_fb_connect.install
index 6ee596c..6c3a604 100644
--- a/simple_fb_connect.install
+++ b/simple_fb_connect.install
@@ -14,12 +14,23 @@
 function simple_fb_connect_requirements($phase) {
   $requirements = array();
 
+  /**
+   * Variable used to store number of levels to check, starting from Drupal root
+   * (level 0) going one level up (in case Drupal is installed with Composer).
+   */
+  $levels = 1;
+
   if ($phase == 'install') {
     $sdk_found = FALSE;
+    $composer_file_found = FALSE;
+
+    for ($i = 0; $i <= $levels; ++$i) {
 
-    if ($json = simple_fb_connect_read_packages()) {
+      $json = simple_fb_connect_read_packages($i);
+      if (!$json) {
+        $composer_file_found = TRUE;
+      }
 
-      // Loop through installed packages and check that the SDK version is OK.
       foreach ($json as $package) {
         if ($package['name'] == 'facebook/graph-sdk') {
           $sdk_found = TRUE;
@@ -29,11 +40,21 @@ function simple_fb_connect_requirements($phase) {
               'severity' => REQUIREMENT_ERROR,
             ];
           }
+          return $requirements;
         }
       }
-
-      // SDK was not found in installed.json.
-      if (!$sdk_found) {
+    }
+    // SDK was not found.
+    if (!$sdk_found) {
+      //SDK was not found because installed.json could not be read or parsed (either because it was not found).
+      if (!$composer_file_found) {
+        $requirements['simple_fb_connect'] = [
+          'description' => t('Simple FB Connect could not be installed: installed.json could not be read.'),
+          'severity' => REQUIREMENT_ERROR,
+        ];
+      }
+      //SDK was not found because Facebook SDK Library was not found.
+      else {
         $requirements['simple_fb_connect'] = [
           'description' => t('Simple FB Connect could not be installed because Facebook SDK library was not found. Simple FB Connect must be installed using Composer. Please read the installation instructions from README.txt.'),
           'severity' => REQUIREMENT_ERROR,
@@ -41,17 +62,9 @@ function simple_fb_connect_requirements($phase) {
       }
     }
 
-    // installed.json could not be read or parsed.
-    else {
-      $requirements['simple_fb_connect'] = [
-        'description' => t('Simple FB Connect could not be installed: installed.json could not be read.'),
-        'severity' => REQUIREMENT_ERROR,
-      ];
-    }
   }
 
   return $requirements;
-
 }
 
 /**
@@ -61,21 +74,20 @@ function simple_fb_connect_requirements($phase) {
  *   Parsed installed.json if the file could be read and parsed.
  *   False otherwise.
  */
-function simple_fb_connect_read_packages() {
-  // Make this test compatible with either regular installs,
-  // when DRUPAL_ROOT is the actual website filesystem root,
-  // or composer drupal-scaffold installs when DRUPAL_ROOT is set in
-  // /web/ subdirectory.
-  $base_dir = is_dir(DRUPAL_ROOT . '/vendor') ? DRUPAL_ROOT : dirname(DRUPAL_ROOT);
-  $file_path = $base_dir . '/vendor/composer/installed.json';
-  if (file_exists($file_path)) {
-    if ($filedata = @file_get_contents($file_path)) {
-      $json = @json_decode($filedata, TRUE);
-      if ($json !== NULL) {
-        return $json;
+function simple_fb_connect_read_packages($levels) {
+  $base_dir = dirname(DRUPAL_ROOT, $levels);
+  if (is_dir($base_dir . '/vendor')) {
+    $file_path = $base_dir . '/vendor/composer/installed.json';
+    if (file_exists($file_path)) {
+      if ($filedata = @file_get_contents($file_path)) {
+        $json = @json_decode($filedata, TRUE);
+        if ($json !== NULL) {
+          return $json;
+        }
       }
     }
   }
+
   return FALSE;
 }
 
