Created
January 28, 2020 16:50
-
-
Save churchthecat/a7b43c2f6cf4f0c2b362ce5b5766642e to your computer and use it in GitHub Desktop.
teachers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Utan: const mysql = require("promise-mysql"); | |
const config = require("./config.json"); i början av teachers.js ger felet: | |
anders@andershpjobb ~/BTH/Dbwebbkurser/databas/me/kmom02/search $ node teachers.js | |
(node:13696) UnhandledPromiseRejectionWarning: ReferenceError: mysql is not defined | |
at /home/anders/BTH/Dbwebbkurser/databas/me/kmom02/search/teachers.js:11:16 | |
at Object.<anonymous> (/home/anders/BTH/Dbwebbkurser/databas/me/kmom02/search/teachers.js:59:3) | |
at Module._compile (module.js:652:30) | |
at Object.Module._extensions..js (module.js:663:10) | |
at Module.load (module.js:565:32) | |
at tryModuleLoad (module.js:505:12) | |
at Function.Module._load (module.js:497:3) | |
at Function.Module.runMain (module.js:693:10) | |
at startup (bootstrap_node.js:188:16) | |
at bootstrap_node.js:609:3 | |
(node:13696) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) | |
(node:13696) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vidare fel när jag föröker få ut i tabell med följande kod :
// Output as formatted text in table
let str;
Ger felet:
(node:13826) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of undefined
at /home/anders/BTH/Dbwebbkurser/databas/me/kmom02/search/teachers.js:52:24
at
(node:13826) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13826) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
rad 52 är: str += row.lon.toString().padStart(8);