Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install problem #169

Open
ecashier-help opened this issue Jun 19, 2024 · 2 comments
Open

install problem #169

ecashier-help opened this issue Jun 19, 2024 · 2 comments
Labels

Comments

@ecashier-help
Copy link

ecashier-help commented Jun 19, 2024

Describe the bug
Can't run with or without docker

To Reproduce

  • I have edited and renamed config.yaml:
[~/telegram-support-bot-4.1.1]$ ls -l config
total 8
-rw-rw-r-- 1 sergeyb sergeyb 4738 Jun 19 14:56 config.yaml

After that:

  • If i run npm install and npm run dev, i get:
[~/telegram-support-bot-4.1.1]$ sudo npm run dev

> [email protected] dev
> ts-node-dev ./src/index.ts

[INFO] 15:34:36 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 4.9.4)
Error: The module '/home/sergeyb/telegram-support-bot-4.1.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 108. This version of Node.js requires
NODE_MODULE_VERSION 109. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Module._extensions..node (node:internal/modules/cjs/loader:1452:18)
    at Object.nodeDevHook [as .node] (/home/sergeyb/telegram-support-bot-4.1.1/node_modules/ts-node-dev/lib/hook.js:63:13)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at bindings (/home/sergeyb/telegram-support-bot-4.1.1/node_modules/bindings/bindings.js:112:48)
    at new Database (/home/sergeyb/telegram-support-bot-4.1.1/node_modules/better-sqlite3/lib/database.js:48:64)
    at Object.<anonymous> (/home/sergeyb/telegram-support-bot-4.1.1/src/db.ts:2:12)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
[ERROR] 15:34:38 Error: The module '/home/sergeyb/telegram-support-bot-4.1.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 108. This version of Node.js requires
NODE_MODULE_VERSION 109. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
  • if i run with docker compose up -d:
supportbot-1  |
supportbot-1  | > [email protected] prod
supportbot-1  | > ts-node ./src/index.ts
supportbot-1  |
supportbot-1  | Error: ENOENT: no such file or directory, open './config/config.yaml'
supportbot-1  |     at Object.openSync (node:fs:599:3)
supportbot-1  |     at Object.readFileSync (node:fs:467:35)
supportbot-1  |     at Object.<anonymous> (/bot/src/cache.ts:20:6)
supportbot-1  |     at Module._compile (node:internal/modules/cjs/loader:1112:14)
supportbot-1  |     at Module.m._compile (/bot/node_modules/ts-node/src/index.ts:1618:23)
supportbot-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
supportbot-1  |     at Object.require.extensions.<computed> [as .ts] (/bot/node_modules/ts-node/src/index.ts:1621:12)
supportbot-1  |     at Module.load (node:internal/modules/cjs/loader:988:32)
supportbot-1  |     at Function.Module._load (node:internal/modules/cjs/loader:834:12)
supportbot-1  |     at Module.require (node:internal/modules/cjs/loader:1012:19) {
supportbot-1  |   errno: -2,
supportbot-1  |   syscall: 'open',
supportbot-1  |   code: 'ENOENT',
supportbot-1  |   path: './config/config.yaml'
supportbot-1  | }
supportbot-1  |
supportbot-1  | > [email protected] prod
supportbot-1  | > ts-node ./src/index.ts
supportbot-1  |
supportbot-1  | Error: ENOENT: no such file or directory, open './config/config.yaml'
supportbot-1  |     at Object.openSync (node:fs:599:3)
supportbot-1  |     at Object.readFileSync (node:fs:467:35)
supportbot-1  |     at Object.<anonymous> (/bot/src/cache.ts:20:6)
supportbot-1  |     at Module._compile (node:internal/modules/cjs/loader:1112:14)
supportbot-1  |     at Module.m._compile (/bot/node_modules/ts-node/src/index.ts:1618:23)
supportbot-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
supportbot-1  |     at Object.require.extensions.<computed> [as .ts] (/bot/node_modules/ts-node/src/index.ts:1621:12)
supportbot-1  |     at Module.load (node:internal/modules/cjs/loader:988:32)
supportbot-1  |     at Function.Module._load (node:internal/modules/cjs/loader:834:12)
supportbot-1  |     at Module.require (node:internal/modules/cjs/loader:1012:19) {
supportbot-1  |   errno: -2,
supportbot-1  |   syscall: 'open',
supportbot-1  |   code: 'ENOENT',
supportbot-1  |   path: './config/config.yaml'
supportbot-1  | }
supportbot-1  |
supportbot-1  | > [email protected] prod
supportbot-1  | > ts-node ./src/index.ts
supportbot-1  |
supportbot-1  | Error: ENOENT: no such file or directory, open './config/config.yaml'
supportbot-1  |     at Object.openSync (node:fs:599:3)
supportbot-1  |     at Object.readFileSync (node:fs:467:35)
supportbot-1  |     at Object.<anonymous> (/bot/src/cache.ts:20:6)
supportbot-1  |     at Module._compile (node:internal/modules/cjs/loader:1112:14)
supportbot-1  |     at Module.m._compile (/bot/node_modules/ts-node/src/index.ts:1618:23)
supportbot-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
supportbot-1  |     at Object.require.extensions.<computed> [as .ts] (/bot/node_modules/ts-node/src/index.ts:1621:12)
supportbot-1  |     at Module.load (node:internal/modules/cjs/loader:988:32)
supportbot-1  |     at Function.Module._load (node:internal/modules/cjs/loader:834:12)
supportbot-1  |     at Module.require (node:internal/modules/cjs/loader:1012:19) {
supportbot-1  |   errno: -2,
supportbot-1  |   syscall: 'open',
supportbot-1  |   code: 'ENOENT',
supportbot-1  |   path: './config/config.yaml'
supportbot-1  | }
supportbot-1  |
supportbot-1  | > [email protected] prod
supportbot-1  | > ts-node ./src/index.ts
supportbot-1  |
supportbot-1  | Error: ENOENT: no such file or directory, open './config/config.yaml'
supportbot-1  |     at Object.openSync (node:fs:599:3)
supportbot-1  |     at Object.readFileSync (node:fs:467:35)
supportbot-1  |     at Object.<anonymous> (/bot/src/cache.ts:20:6)
supportbot-1  |     at Module._compile (node:internal/modules/cjs/loader:1112:14)
supportbot-1  |     at Module.m._compile (/bot/node_modules/ts-node/src/index.ts:1618:23)
supportbot-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
supportbot-1  |     at Object.require.extensions.<computed> [as .ts] (/bot/node_modules/ts-node/src/index.ts:1621:12)
supportbot-1  |     at Module.load (node:internal/modules/cjs/loader:988:32)
supportbot-1  |     at Function.Module._load (node:internal/modules/cjs/loader:834:12)
supportbot-1  |     at Module.require (node:internal/modules/cjs/loader:1012:19) {
supportbot-1  |   errno: -2,
supportbot-1  |   syscall: 'open',
supportbot-1  |   code: 'ENOENT',
supportbot-1  |   path: './config/config.yaml'
supportbot-1  | }
supportbot-1  |
supportbot-1  | > [email protected] prod
supportbot-1  | > ts-node ./src/index.ts
supportbot-1  |
supportbot-1  | Error: ENOENT: no such file or directory, open './config/config.yaml'
supportbot-1  |     at Object.openSync (node:fs:599:3)
supportbot-1  |     at Object.readFileSync (node:fs:467:35)
supportbot-1  |     at Object.<anonymous> (/bot/src/cache.ts:20:6)
supportbot-1  |     at Module._compile (node:internal/modules/cjs/loader:1112:14)
supportbot-1  |     at Module.m._compile (/bot/node_modules/ts-node/src/index.ts:1618:23)
supportbot-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
supportbot-1  |     at Object.require.extensions.<computed> [as .ts] (/bot/node_modules/ts-node/src/index.ts:1621:12)
supportbot-1  |     at Module.load (node:internal/modules/cjs/loader:988:32)
supportbot-1  |     at Function.Module._load (node:internal/modules/cjs/loader:834:12)
supportbot-1  |     at Module.require (node:internal/modules/cjs/loader:1012:19) {
supportbot-1  |   errno: -2,
supportbot-1  |   syscall: 'open',
supportbot-1  |   code: 'ENOENT',
supportbot-1  |   path: './config/config.yaml'
supportbot-1  | }
supportbot-1  |
supportbot-1  | > [email protected] prod
supportbot-1  | > ts-node ./src/index.ts
supportbot-1  |
  • node version 18.19.1
  • I tried to use nvm with node version 13 and 14 - getting same errors
[~/telegram-support-bot-4.1.1]$ nvm list node
       v13.14.0
->     v14.21.3
         system
[~/telegram-support-bot-4.1.1]$ nvm deactivate
/home/sergeyb/.nvm/*/bin removed from ${PATH}
[~/telegram-support-bot-4.1.1]$ node -v
v18.19.1
Copy link

Hello there! As you are a first time Issuer please check whether your issue description is reasonable and complete. If you are having an issue always include the versions you are using (NodeJs, Typescript, ...) as well as a way to reproduce it. Thank you for reading! Now continue :)

@mohammadrz003
Copy link

mohammadrz003 commented Sep 15, 2024

on windows, if you're using docker, you mustn't use ${PWD} in the volumes of docker-compose. change that to a relative path like ./config:/bot/config and you're good to go!

referrence:
#150 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants