Задать вопрос
Nikito4ka_ka
@Nikito4ka_ka

Как решить ошибку сервера Server error: res is not defined?

Локально проект запускался нормально, когда выложил на хостинг выводится ошибка при старте node.js server:

Server error: res is not defined

вроде запускается нормально сначала, но секунд через 5 просто завершается

[altairre.ae/server (14)] [altair@business95 server]$ npm run start
npm WARN lifecycle The node binary used for scripts is /home/altair/nodevenv/altairre.ae/server/14/bin/node but npm is using /opt/alt/alt-nodejs14/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> altairserver@0.0.1 start /home/altair/altairre.ae/server
> node index.js

Executing (default): SELECT 1+1 AS result
Executing (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'user' AND TABLE_SCHEMA = 'altair_db'
connected..
Executing (default): SHOW INDEX FROM `user` FROM `altair_db`
Executing (default): SELECT 1+1 AS result
Executing (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'userInfo' AND TABLE_SCHEMA = 'altair_db'
Executing (default): SELECT 1+1 AS result
Executing (default): SHOW INDEX FROM `userInfo` FROM `altair_db`
Server error: res is not defined
Executing (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'status' AND TABLE_SCHEMA = 'altair_db'
Executing (default): SHOW INDEX FROM `status` FROM `altair_db`
Executing (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'Property' AND TABLE_SCHEMA = 'altair_db'
Executing (default): SHOW INDEX FROM `Property` FROM `altair_db`
Executing (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'Category' AND TABLE_SCHEMA = 'altair_db'
Executing (default): SHOW INDEX FROM `Category` FROM `altair_db`
Executing (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'City' AND TABLE_SCHEMA = 'altair_db'
Executing (default): SHOW INDEX FROM `City` FROM `altair_db`
Executing (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'TypeProperty' AND TABLE_SCHEMA = 'altair_db'
Executing (default): SHOW INDEX FROM `TypeProperty` FROM `altair_db`
Executing (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'PropertyInfo' AND TABLE_SCHEMA = 'altair_db'
Executing (default): SHOW INDEX FROM `PropertyInfo` FROM `altair_db`
yes re-sync done!
[altairre.ae/server (14)] [altair@business95 server]$


Подскажите в чем проблема? проверял вроде нет функций где не объявлял res
  • Вопрос задан
  • 64 просмотра
Подписаться 1 Простой 2 комментария
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы