SilveryStar/Adachi-BOT

重启服务器后启动报错

Accelerator1213 opened this issue · 8 comments

系统版本

centos_8_0_x64

Node.js 版本

13.13.0

应用版本

2.2.3-optimize1

启动方式

Docker

复述操作

服务器重启了一下,然后

  • docker-compose stop
  • git pull
  • docker-compose up -d (可能是我脑子抽了才运行了这个)
  • docker-compose start
  • npm start

可能和运行了一次 up -d有关?

还有拯救办法吗=-=

配置文件

错误报告

[root@Genshin Adachi-BOT]# npm start

> adachi-bot@2.2.3-optimize1 start /root/Adachi-BOT
> ts-node -r tsconfig-paths/register app.ts --files


/root/Adachi-BOT/node_modules/ts-node/src/index.ts:513
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/modules/bot.ts:18:19 - error TS2307: Cannot find module 'axios' or its corresponding type declarations.

18 import axios from "axios";
                     ~~~~~~~

    at createTSError (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:513:12)
    at reportTSError (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:517:19)
    at getOutput (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:752:36)
    at Object.compile (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:968:32)
    at Module.m._compile (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:1056:42)
    at Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Object.require.extensions.<computed> [as .ts] (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:1059:12)
    at Module.load (internal/modules/cjs/loader.js:972:32)
    at Function.Module._load (internal/modules/cjs/loader.js:872:14)
    at Module.require (internal/modules/cjs/loader.js:1012:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! adachi-bot@2.2.3-optimize1 start: `ts-node -r tsconfig-paths/register app.ts --files`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the adachi-bot@2.2.3-optimize1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-12-09T08_54_23_688Z-debug.log

我的,我忘了新版本加了新的库要改镜像版本(

docker-compose stop
docker rm adachi-bot
docker rmi adachi-bot:2.2.0
docker-compose up -d

加下频道吧,这种事情以后方便通知一点

我在频道里hhhhhhh

[root@Genshin Adachi-BOT]# npm start

adachi-bot@2.2.3-optimize1 start /root/Adachi-BOT
ts-node -r tsconfig-paths/register app.ts --files

/root/Adachi-BOT/node_modules/ts-node/src/index.ts:513
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
src/modules/bot.ts:18:19 - error TS2307: Cannot find module 'axios' or its corresponding type declarations.

18 import axios from "axios";
~~~~~~~

at createTSError (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:513:12)
at reportTSError (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:517:19)
at getOutput (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:752:36)
at Object.compile (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:968:32)
at Module.m._compile (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:1056:42)
at Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Object.require.extensions.<computed> [as .ts] (/root/Adachi-BOT/node_modules/ts-node/src/index.ts:1059:12)
at Module.load (internal/modules/cjs/loader.js:972:32)
at Function.Module._load (internal/modules/cjs/loader.js:872:14)
at Module.require (internal/modules/cjs/loader.js:1012:19)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! adachi-bot@2.2.3-optimize1 start: ts-node -r tsconfig-paths/register app.ts --files
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the adachi-bot@2.2.3-optimize1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-12-09T09_52_33_904Z-debug.log

怎么感觉操作一波下来还是相同的错误hhhhhhhh

我要不重新clone一份。

你更新了 docker 就不要再 npm start 了啊2333

但是bot没启动~ 我重启的服务器。

哦吼,好像开的?

对啊,你重启服务器之后 docker-compose start 就行了

Thanks~