DEV Community

Discussion on: Build a simple app using Node JS and MySQL.

Collapse
 
kowalsk profile image
kowalsk

Hi Atauba,

I followed your tutorial and have the following error. Do you have any clues as to why this is so:

C:\Users\PC\OneDrive\Coding\JS\node-mysql-crud-app>nodemon app.js
[nodemon] 1.18.10
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node app.js
C:\Users\PC\OneDrive\Coding\JS\node-mysql-crud-app\routes\index.js:11
title: Welcome to Socka | View Players
^^

SyntaxError: Unexpected identifier
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
[nodemon] app crashed - waiting for file changes before starting...
^CTerminate batch job (Y/N)? y

Collapse
 
wolgensinger profile image
wolgensinger

I have the same error on line 11. Do you have any hints or a solution? Thank you for a short reply.

Collapse
 
nitesh146 profile image
Nitesh Kesarkar

Try adding the "" for the title values wherever this error shows.

Collapse
 
achowba profile image
Prince • Edited

Hi, sorry for the late reply, check if all brackets/braces have been closed and ensure you added the comma after the title key in the res.render function of the index.js file.

Collapse
 
tjs1990hub profile image
tjs1990-hub

Hi i have also got this error, i have re written the file to make sure all brackets are closed and that the comma is in the right place i have even tried making it an if else statement but still can't get it to run. Any help would be greatly appreciated.