Cordova plugin File, FileTransfer with Nodejs compatibility issue


I just updated to node v9.6.1 and I notice that cordova support for file and file transfer suddenly stops working. In particular my code use to check the platform where my app run and initialized the storage directory for the device.


import { FileTransfer, FileTransferObject } from ‘@ionic- native/file-transfer’;
import { File } from ‘@ionic-native/file’;

declare var cordova: any;

constructor(…) {
this.platform.ready().then(() => {
//make sure this runs on an actual device and not on an emulation (e.g. chrome tools device mode)
if (!‘cordova’)) {
return false;

              if ('ios')) {
                this.storageDirectory = cordova.file.documentsDirectory;
              else if ('android')) {
                this.storageDirectory = cordova.file.externalRootDirectory;
              } else {
                // exit otherwise, but we could add additional types here (e.g. "Windows")
                return false;



the above code was successfully able to initialized storageDirectory correctly but eversince i updated to node 9.6.1 it starts to break. Does anyone know how to get around with this issue?

Thanks in advance.