Parsoid:意外的令牌错误且无法初始化

时间:2019-03-12 04:06:11

标签: config mediawiki parsoid

mwApis:
    - # This is the only required parameter,
      # the URL of you MediaWiki API endpoint.
      uri: 'http://spgenerations.com/wiki/api.php'

在Linux机器上,我可以卷曲该URL并接收api数据。

无论使用apt-get安装还是开发人员安装(ngm安装),两个实例都给我这个错误:

{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12636,"level":30,"levelPath":"info/service-runner","msg":"master(12636) initializing 2 workers","time":"2019-03-12T03:55:47.504Z","v":0}

{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12645,"level":60,"moduleName":"lib/index.js","levelPath":"fatal/service-runner/worker","msg":"Unexpected token ...","time":"2019-03-12T03:55:47.917Z","v":0}

{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12636,"level":40,"message":"first worker died during startup, continue startup","worker_pid":12645,"exit_code":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"first worker died during startup, continue startup","time":"2019-03-12T03:55:48.925Z","v":0}

对于上下文,此处的主机名不正确,并且该域已被删除。

这是我的仿形配置:

// Parsoid configuration
$wgVirtualRestConfig['modules']['parsoid'] = array(
'url' => 'server.spgenerations.com',
'forwardCookies' => true
);

我已经尝试了在隐藏的伏都教阳光下进行的所有操作,以使此功能正常工作,但我感到无比沮丧。花费4个小时修补URL链接无济于事,所以,如果您知道与此错误有关的任何信息,请伸出援助之手。

1 个答案:

答案 0 :(得分:0)

检查运行的Node.JS版本:

nodejs --version

如果它是 4.x :对于Parsoid来说太旧了。我遇到了同样的情况(Debian 9,在存储库中仍然是一个旧的Node.JS版本。)。升级到10.x后,它对我来说运行正常。

我使用了以下指南(请参阅使用PPA安装)来更新到较新的Node.JS版本:https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-debian-9