Mastodon streaming service failed: Error: Cannot find module ‘…/dist/bindings/cws_linux_57’

After installed mastodon on my server, I noticed
GET /api/v1/notifications?exclude_types[]=follow_request 502
from the console tab of my browser. Then I looked into the server and found out the mastodon-streaming.service failed. Here is what I got using journalctl -u mastodon-streaming

Jul 18 06:35:36 ip-172-31-3-35 node[3875]: /home/mastodon/live/node_modules/@clusterws/cws/dist/shared.js:18
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: throw err;
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: ^
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: Error: Cannot find module ‘…/dist/bindings/cws_linux_57’ check ‘./node_modules/@clusterws/cws/build_log.txt’ for post install
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at Function.Module._resolveFilename (module.js:547:15)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at Function.Module._load (module.js:474:25)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at Module.require (module.js:596:17)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at require (internal/module.js:11:18)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at exports.native (/home/mastodon/live/node_modules/@clusterws/cws/dist/shared.js:14:16)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at Object. (/home/mastodon/live/node_modules/@clusterws/cws/dist/shared.js:20:3)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at Module._compile (module.js:652:30)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at Object.Module._extensions…js (module.js:663:10)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at Module.load (module.js:565:32)
Jul 18 06:35:36 ip-172-31-3-35 node[3875]: at tryModuleLoad (module.js:505:12)
Jul 18 06:35:36 ip-172-31-3-35 systemd[1]: mastodon-streaming.service: Main process exited, code=exited, status=1/FAILURE
Jul 18 06:35:36 ip-172-31-3-35 systemd[1]: mastodon-streaming.service: Failed with result ‘exit-code’.
Jul 18 06:35:36 ip-172-31-3-35 systemd[1]: mastodon-streaming.service: Service hold-off time over, scheduling restart.
Jul 18 06:35:36 ip-172-31-3-35 systemd[1]: mastodon-streaming.service: Scheduled restart job, restart counter is at 1.

I purged the live directory and redo the installation again but it didn’t work.
Here is the build_log.
I’ve doing a little bit search on google but nothing helpful.

Any idea about where goes wrong ?

Can you check if you have two different node versions installed by chance? The module builds fine with node@12.18.2 but the streaming service seems to be running under node 8 (it is searching for node module version 57).

Thanks! That solved my problem.

1 Like