DVBProject/DVB-I-Reference-CSR

mysql2 installed but mysql referenced

Closed this issue · 7 comments

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.

what was your environment?

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

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.

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...

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.

Ah that explains the cloning difference anyway.

Fixed in 0.15