我正在尝试使用 laravel react js 的 ssr。虽然我正在为 laravel 使用 spatie ssr 包。所有配置设置已完成。但是每当我试图运行它的抛出错误时
public function mustRun(callable $callback = null, array $env = [])
{
if (0 !== $this->run($callback, $env)) {
throw new ProcessFailedException($this);
}
return $this;
}
"""
The command "node D:\Deepak\react\storage\app/ssr\95698e4a8cd89030841216d9c8ae9b83.js" failed.\n
\n
Exit Code: 1(General error)\n
\n
Working directory: D:\Deepak\react\public\n
\n
Output:\n
================\n
\n
\n
Error Output:\n
================\n
'node' is not recognized as an internal or external command,\r\n
operable program or batch file.\r\n
(View: D:\Deepak\react\resources\views\welcome.blade.php)
我还检查了节点版本和系统环境路径设置。万事皆安。
节点版本 8.9.4
public function mustRun(callable $callback = null, array $env = [])
{
if (0 !== $this->run($callback, $env)) {
throw new ProcessFailedException($this);
}
return $this;
}
/**
* Starts the process and returns after writing the input to STDIN.
*
* This method blocks until all STDIN data is sent to the process then it
* returns while the process runs in the background.
*
* The termination of the process can be awaited with wait().
*
* The callback receives the type of output (out or err) and some bytes from
* the output in real-time while writing the standard input to the process.
* It allows to have feedback from the independent process during execution.
*
* @param callable|null $callback A PHP callback to run whenever there is some
* output available on STDOUT or STDERR
* @param array $env An array of additional env vars to set when running the process
论据
"""
The command "node D:\Deepak\react\storage\app/ssr\95698e4a8cd89030841216d9c8ae9b83.js" failed.\n
\n
Exit Code: 1(General error)\n
\n
Working directory: D:\Deepak\react\public\n
\n
Output:\n
================\n
\n
\n
Error Output:\n
================\n
'node' is not recognized as an internal or external command,\r\n
operable program or batch file.\r\n
(View: D:\Deepak\react\resources\views\welcome.blade.php)