https://docs.nodebb.org/installing/os/ubuntu/
我正在按照 NodeBB 文档(上面附加的链接)在我的计算机上本地设置 nodeBB - 但是,我陷入了“安装 nodeBB”步骤并出现以下错误。
$ ./nodebb start
/home/pravallika/nodebb/node_modules/commander/lib/command.js:380
enableOrNameAndArgs = enableOrNameAndArgs ?? 'help [command]';
^
SyntaxError: Unexpected token ?
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/pravallika/nodebb/node_modules/commander/index.js:2:21)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
浏览解决方案,我看到了与nodeJS版本相关的建议,所以我也检查了它,我不认为这是问题所在。不确定如何继续。
规格和安装:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6
LTS Release: 20.04
Codename: focal
$ node -v
v10.19.0
$ npm -v
6.14.4
将节点版本升级到 v22.1.0 解决了该问题