如何解决新安装启动时出现node-red错误

问题描述 投票:0回答:1

我已经从npm安装了node-red(但与snap的结果相同),一旦我运行node-red,我就会出现此错误:

root@debian:/home/ipergola# node-red
/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:797
    if (sendEvent?.destination?.node) {
                  ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:19:12)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

我并不是真正的node-red专家,欢迎所有帮助......

node-red
1个回答
0
投票

该错误意味着您使用的 NodeJS 版本不支持

?.
语法。

您没有说您安装了哪个版本的 Node-RED,但我怀疑它是 3.1.0,因为这是最新的。支持的最低 NodeJS 版本是 14,但由于 NodeJS 16 已经不再支持,因此您不应该在低于 NodeJS 18 的版本上安装任何新内容。

© www.soinside.com 2019 - 2024. All rights reserved.