diff --git a/lib/node-package-manager.ts b/lib/node-package-manager.ts index 179d624a8a..7b9ad7f05e 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 4a8662ab8c..a96e206c95 100644 --- a/lib/services/doctor-service.ts +++ b/lib/services/doctor-service.ts @@ -226,17 +226,18 @@ class DoctorService implements IDoctorService { let hasInvalidPackages = false; if (this.$hostInfo.isDarwin) { try { - let queryForSixPackage = await this.$childProcess.exec(`pip freeze | grep '^six=' | wc -l`); - let sixPackagesFoundCount = parseInt(queryForSixPackage); - if (sixPackagesFoundCount === 0) { + 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) { 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;