diff --git a/src/Robo/Plugin/Commands/ThemeCommands.php b/src/Robo/Plugin/Commands/ThemeCommands.php index 13dacdc..c46fd83 100644 --- a/src/Robo/Plugin/Commands/ThemeCommands.php +++ b/src/Robo/Plugin/Commands/ThemeCommands.php @@ -48,7 +48,10 @@ public function themeBuild($siteName = 'default'): Result $themePath = $themeConfig['theme_path']; $this->io()->section("building theme at $themePath"); foreach ($themeConfig['theme_build_commands'] as $themeBuildCommand) { - $result = $this->taskExec($themeBuildCommand) + // Run theme build commands in a Bash subshell with login mode + // enabled to ensure nvm is loaded prior to running any + // Node-based commands. + $result = $this->taskExec("bash -lc \"$themeBuildCommand\"") ->dir($themePath) ->run(); }