programming-dot-dev / rss-bot

A lemmy/sublinks bot that watches rss feeds and posts new posts from them in communities
GNU Affero General Public License v3.0
33 stars 8 forks source link

Unable to install #6

Open Vittelius opened 1 year ago

Vittelius commented 1 year ago

I'm unable to setup the bot. When I run node main.js I get the following error:

~/Lemmy-Mega-Bot/main.js:1
import LemmyBot from 'lemmy-bot';
       ^^^^^^^^

SyntaxError: Unexpected identifier
    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 Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Vittelius commented 1 year ago

I've solved the problem. Turns out I was running an outdated version of node.js. But after upgrading to node 20.5.1 I'm getting new error messages:

node:internal/modules/cjs/loader:1048
  const err = new Error(message);
              ^

Error: Cannot find module '~/Lemmy-Mega-Bot-2.1.0/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node'
Require stack:
- ~/Lemmy-Mega-Bot-2.1.0/node_modules/sqlite3/lib/sqlite3-binding.js
- ~/Lemmy-Mega-Bot-2.1.0/node_modules/sqlite3/lib/sqlite3.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (~/Lemmy-Mega-Bot-2.1.0/node_modules/sqlite3/lib/sqlite3-binding.js:4:17)
    at Module._compile (node:internal/modules/cjs/loader:1233:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~/Lemmy-Mega-Bot-2.1.0/node_modules/sqlite3/lib/sqlite3-binding.js',
    '~/Lemmy-Mega-Bot-2.1.0/node_modules/sqlite3/lib/sqlite3.js'
  ]
}

I've checked sqlite3 is installed

mjpc13 commented 1 year ago

If you want, you can use Docker, check this PR and you won't have these dependencies problems.

Ategon commented 1 year ago

Weird, I can check it out in maybe around a week, 2 weeks. Ive been using somewhere around node version 18