Node js Deploiement Plesk 错误:age/Spa/Spa/SpawnEnvSetupperMain.cpp:747 ]: shellName = 'false' 被检测为支



当我在plesk服务器中部署我的node js应用程序时,我有这个错误
我不明白这个问题:"age/Spa/SpawnEnvSetupperMain.cpp:747]: shellName = 'false'检测到支持'-l': false';
有人能帮我一下吗?

对于Angular Universal,我已经弄清楚了:

原因在server.ts:文件底部的if语句不允许run()函数运行。基本上,moduleFilename的值与我们本地环境中通常匹配的fileName不匹配。

我所做的是删除if并将整个块替换为以下内容。这不会阻止在本地机器上以ssr模式(yarn dev:ssr)服务应用程序。

...
function run(): void {
console.info("Starting up the Node server...");
const server = app();
const port = process.env['PORT'] || 4000;
server.listen(port);
console.info(`Node Express listening on port ${port}`);
}
// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
// declare const __non_webpack_require__: NodeRequire;
// const mainModule = __non_webpack_require__.main;
// const moduleFilename = mainModule && mainModule.filename || '';
run();

我们可以在Plesk的passenger.log中看到info log。

App 991867 output: 991867/T1 age/Spa/SpawnEnvSetupperMain.cpp:747: shellName = 'bash' detected as supporting '-l': true
> Normally here, it stops logging and you will see a timout error. By removing the if statement server starts and you see more logs.
App 991867 output: Starting up the Node server...
App 991867 output: Node Express listening on port 443

另外,您可以记录moduleFilename,看看里面是什么,以及为什么删除所有这些条件的if语句是安全的。Angular的开发人员不听我们的,我们只能苦苦挣扎,直到有人想出解决方案。

最新更新