当前位置:网站首页>Fe - eggjs combined with typeorm cannot connect to the database
Fe - eggjs combined with typeorm cannot connect to the database
2022-07-02 06:39:00 【Xiao Ming Yuan】
problem
eggjs combination typeorm When packaging and deploying , Consistent error reporting , At first I thought it was eggjs The problem of
[egg-scripts] Got error when startup:
[egg-scripts] at createScript (vm.js:251:10)
[egg-scripts] at Object.runInThisContext (vm.js:303:10)
[egg-scripts] at Module._compile (internal/modules/cjs/loader.js:656:28)
[egg-scripts] at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[egg-scripts] at Module.load (internal/modules/cjs/loader.js:598:32)
[egg-scripts] at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[egg-scripts] at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[egg-scripts] at Module.require (internal/modules/cjs/loader.js:636:17)
[egg-scripts] at require (internal/modules/cjs/helpers.js:20:18)
[egg-scripts]
[egg-scripts] pid: 30800
[egg-scripts] hostname: labelnet
[egg-scripts]
[egg-scripts] 2019-03-05 15:17:28,085 ERROR 30796 [-/127.0.0.1/-/1ms GET /] nodejs.SyntaxError: Unexpected token {
[egg-scripts] (function (exports, require, module, __filename, __dirname) { import {
[egg-scripts] ^
[egg-scripts]
[egg-scripts] SyntaxError: Unexpected token {
[egg-scripts] at new Script (vm.js:79:7)
[egg-scripts] at createScript (vm.js:251:10)
[egg-scripts] at Object.runInThisContext (vm.js:303:10)
[egg-scripts] at Module._compile (internal/modules/cjs/loader.js:656:28)
[egg-scripts] at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[egg-scripts] at Module.load (internal/modules/cjs/loader.js:598:32)
[egg-scripts] at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[egg-scripts] at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[egg-scripts] at Module.require (internal/modules/cjs/loader.js:636:17)
[egg-scripts] at require (internal/modules/cjs/helpers.js:20:18)
eggjs Of issues Have seen similar problems ,
https://github.com/eggjs/egg/issues/2388
But the official website documents have clearly stated , Load back first js file Post load ts file , I always thought it was eggjs The problem of ;
function npm start Will not load ts
I didn't think so typeorm Configuration problem of ,entity The configuration is ts file , The production environment needs to be configured js file
typeorm It doesn't load automatically entity Of js file
solve
development environment entity load ts file , Production environment load js file
"db_dev": {
"database": "ruisite-dash-server",
"host": "127.0.0.1",
"port": "3306",
"username": "root",
"password": "root",
"logging": true,
"entities": ["app/entity/*.ts", "app/entity/*/*.ts"]
}
"db_production": {
"database": "ruisite-dash-server",
"host": "192.168.100.10",
"port": "3306",
"username": "root",
"password": "root",
"logging": true,
"entities": ["app/entity/*.js", "app/entity/*/*.js"]
}
边栏推荐
- Hydration failed because the initial UI does not match what was rendered on the server. One of the reasons for the problem
- 20210306转载如何使TextEdit有背景图片
- 压力测试修改解决方案
- 2020-9-23 use of QT timer qtimer class.
- apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted
- Win10网络图标消失,网络图标变成灰色,打开网络设置闪退等问题解决
- 10 erreurs classiques de MySQL
- Asynchronous data copy in CUDA
- Win10桌面图标没有办法拖动(可以选中可以打开可以删除新建等操作但是不能拖动)
- CUDA中内置的Vector类型和变量
猜你喜欢

pytest(1) 用例收集规则

CUDA中的线程层次

Redis - grande question clé

Shardingsphere JDBC

Présence d'une panne de courant anormale; Problème de gestion de la fsck d'exécution résolu

Detailed definition of tensorrt data format

Sentinel rules persist to Nacos

一口气说出 6 种实现延时消息的方案

由于不正常断电导致的unexpected inconsistency;RUN fsck MANUALLY问题已解决

实现strStr() II
随机推荐
Find the highest value of the current element Z-index of the page
Fe - use of weex development weex UI components and configuration use
apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted
Data science [viii]: SVD (I)
Golang -- map capacity expansion mechanism (including source code)
看完有用的blog
Latex 编译报错 I found no \bibstyle & \bibdata & \citation command
Virtualenv and pipenv installation
FE - Eggjs 结合 Typeorm 出现连接不了数据库
自学table au
Introduce two automatic code generators to help improve work efficiency
MySql索引
利用NVIDIA GPU将Minecraft场景渲染成真实场景
代码技巧——Controller参数注解@RequestParam
MySQL的10大经典错误
Présence d'une panne de courant anormale; Problème de gestion de la fsck d'exécution résolu
CUDA中内置的Vector类型和变量
Redis - grande question clé
NodeJs - Express 中间件修改 Header: TypeError [ERR_INVALID_CHAR]: Invalid character in header content
[literature reading and thought notes 13] unprocessing images for learned raw denoising