DVBProject / DVB-I-Reference-CSR

Project to create a DVB-I Central Service Registry for DVB-I client service (list) discovery
MIT License
8 stars 3 forks source link

mysql2 installed but mysql referenced #8

Closed andyburras closed 2 years ago

andyburras commented 2 years ago

Not sure if this was a problem with the way I did the install, but the "backend/package.json" installs '"mysql2": "^2.3.3"'. However, when running 'node server.js' I got an error "Caught exception: { Error: Cannot find module 'mysql'".

backend/models/app.db.js has "const mysql = require("mysql");" which seems to be the culprit. Editing this to mysql2 allowed the server to run and connect to the database.

juhajoki commented 2 years ago

what was your environment?

andyburras commented 2 years ago

Its was a clean Ubuntu 20.04 VM. Everything seems to work if I just change the node module reference to "mysql2" ?

sofia-tsa commented 2 years ago

backend/package.json has both mysql and mysql2 modules listed so both should be available. I wonder why the mysql-module wasn't found, some issue with yarn version perhaps? Anyway, there is no reason to have both modules so we will change the application to use mysql2 and remove the mysql module altogether.

andyburras commented 2 years ago

That's weird. I cloned the repo yesterday with 'git clone https://github.com/DVBProject/DVB-I-Reference-CSR.git' and I got a different versions of package.json with only mysql2 listed. git diff main origin/main - shows lots of differences.

git remote -v gives: origin https://github.com/DVBProject/DVB-I-Reference-CSR.git (fetch) origin https://github.com/DVBProject/DVB-I-Reference-CSR.git (push)

git status: "On branch main Your branch is behind 'origin/main' by 55 commits, and can be fast-forwarded."

I just tried cloning again with the same command into a different area. git remote -v gives: origin https://github.com/DVBProject/DVB-I-Reference-CSR.git (fetch) origin https://github.com/DVBProject/DVB-I-Reference-CSR.git (push) git status: "On branch main Your branch is up-to-date with 'origin/main'."

I had to do a 'git pull' on the original clone to get it up to date. I've no idea why...

sofia-tsa commented 2 years ago

That's weird. According to the history, https://github.com/DVBProject/DVB-I-Reference-CSR/commits/main/backend/package.json the mysql-reference has always been in the file. I pushed version 0.9 to the repository yesterday that had those 55 new commits compared to the 0.8 version but the mysql-reference should have been there in the 0.8 version also.

andyburras commented 2 years ago

Ah that explains the cloning difference anyway.

sofia-tsa commented 2 years ago

Fixed in 0.15