diff --git a/phpmon/Domain/App/Startup.swift b/phpmon/Domain/App/Startup.swift index 3c73208..2825640 100644 --- a/phpmon/Domain/App/Startup.swift +++ b/phpmon/Domain/App/Startup.swift @@ -184,6 +184,21 @@ class Startup { descriptionText: "startup.errors.valet_json_invalid.desc".localized ), // ================================================================================= + // Check for `which` alias issue + // ================================================================================= + EnvironmentCheck( + command: { + return App.architecture == "x86_64" + && FileManager.default.fileExists(atPath: "/usr/local/bin/which") + && Shell.pipe("which node", requiresPath: false) + .contains("env: node: No such file or directory") + }, + name: "`env: node` issue does not apply", + titleText: "startup.errors.which_alias_issue.title".localized, + subtitleText: "startup.errors.which_alias_issue.subtitle".localized, + descriptionText: "startup.errors.which_alias_issue.desc".localized + ), + // ================================================================================= // Determine the Valet version and ensure it isn't unknown. // ================================================================================= EnvironmentCheck( diff --git a/phpmon/Localizable.strings b/phpmon/Localizable.strings index 98b6421..b39da0c 100644 --- a/phpmon/Localizable.strings +++ b/phpmon/Localizable.strings @@ -365,6 +365,11 @@ You can do this by running `composer global update` in your terminal. After that "startup.errors.services_json_error.subtitle" = "PHP Monitor usually queries `brew` using the following command to test if the services can be retrieved: `sudo brew services info nginx --json`.\n\nPHP Monitor could not interpret this response."; "startup.errors.services_json_error.desc" = "This can happen if your Homebrew installation is out of date, in which case Homebrew won't return JSON yet. You can usually fix this by running `brew update`. You can also try running `sudo brew services info nginx --json` in your terminal of choice."; +/// Issue with `which` alias +"startup.errors.which_alias_issue.title" = "A configuration issue was detected"; +"startup.errors.which_alias_issue.subtitle" = "It appears that there's a file in `/usr/local/bin/which`. This is usually set up by NodeJS, but `node` isn't in the PATH in `/usr/local/bin`. To fix this, keep reading."; +"startup.errors.which_alias_issue.desc" = "You will need to symlink `node` into the `/usr/local/bin` directory to make sure PHP Monitor can start successfully. For more info, see: https://github.com/nicoverbruggen/phpmon/issues/174"; + // SPONSOR ENCOURAGEMENT "startup.sponsor_encouragement.title" = "If PHP Monitor has been useful to you or your company, please consider leaving a tip.";