diff --git a/lib/node-package-manager.ts b/lib/node-package-manager.ts index 7b9ad7f05e..179d624a8a 100644 --- a/lib/node-package-manager.ts +++ b/lib/node-package-manager.ts @@ -77,7 +77,7 @@ export class NodePackageManager implements INodePackageManager { throw err; } } - } + } @exported("npm") public async uninstall(packageName: string, config?: any, path?: string): Promise { diff --git a/lib/services/doctor-service.ts b/lib/services/doctor-service.ts index a96e206c95..4a8662ab8c 100644 --- a/lib/services/doctor-service.ts +++ b/lib/services/doctor-service.ts @@ -226,18 +226,17 @@ class DoctorService implements IDoctorService { let hasInvalidPackages = false; if (this.$hostInfo.isDarwin) { try { - await this.$childProcess.exec(`python -c "import six"`); - } catch (error) { - // error.code = 1 so the Python is present, but we don't have six. - if (error.code === 1) { + let queryForSixPackage = await this.$childProcess.exec(`pip freeze | grep '^six=' | wc -l`); + let sixPackagesFoundCount = parseInt(queryForSixPackage); + if (sixPackagesFoundCount === 0) { hasInvalidPackages = true; this.$logger.warn("The Python 'six' package not found."); this.$logger.out("This package is required by the Debugger library (LLDB) for iOS. You can install it by running 'pip install six' from the terminal."); - } else { - this.$logger.warn("Couldn't retrieve installed python packages."); - this.$logger.out("We cannot verify your python installation is setup correctly. Please, make sure you have both 'python' and 'pip' installed."); - this.$logger.trace(`Error while validating Python packages. Error is: ${error.message}`); } + } catch (error) { + this.$logger.warn("Couldn't retrieve installed python packages."); + this.$logger.out("We cannot verify your python installation is setup correctly. Please, make sure you have both 'python' and 'pip' installed."); + this.$logger.trace(`Error while validating Python packages. Error is: ${error.message}`); } } return hasInvalidPackages;