fix(cordova/util): version detection for legacy platforms (#856)

The new meachanism introduced in #815 relied on all platforms exporting
their version in their version script. This is not the case for the
browser platform though. Thus we need to revert to spawning an external
process for legacy platforms unfortunately.
diff --git a/spec/cordova/util.spec.js b/spec/cordova/util.spec.js
index f95a8d4..09a2a3a 100644
--- a/spec/cordova/util.spec.js
+++ b/spec/cordova/util.spec.js
@@ -107,6 +107,19 @@
                 .then(versions => expect(versions[PLATFORM]).toBe('9.0.0'));
         });
     });
+    describe('getPlatformVersion method', () => {
+        it('should get the version from a legacy platform', () => {
+            const PLATFORM_VERSION = '1.2.3-dev';
+
+            fs.outputFileSync(path.join(temp, 'cordova/version'), `
+                #!/usr/bin/env node
+                console.log('${PLATFORM_VERSION}');
+            `.trim());
+
+            const version = util.getPlatformVersion(temp);
+            expect(version).toBe(PLATFORM_VERSION);
+        });
+    });
     describe('findPlugins method', function () {
         let pluginsDir, plugins;
 
diff --git a/src/cordova/util.js b/src/cordova/util.js
index 3fb5f0f..dab307a 100644
--- a/src/cordova/util.js
+++ b/src/cordova/util.js
@@ -207,9 +207,10 @@
         ).version();
     } catch (e) {
         // Platforms pre-Cordova 10
-        return requireNoCache(
-            path.join(platformPath, 'cordova/version')
-        ).version;
+        return require('execa').sync(
+            process.argv0, // node
+            [path.join(platformPath, 'cordova/version')]
+        ).stdout;
     }
 }