Gold Medal Metrics - 'Module Not Found'

I’m am getting stuck at the start of the Gold Medal Metrics project. After following the instructions to set up the server using node server.js, I get the following error at the terminal.

code: ‘MODULE_NOT_FOUND’,
requireStack: [
‘C:\Users\12892\Documents\Python for Finance\project-5-gold-medal-metrics-start\node_modules\sqlite3\lib\sqlite3-binding.js’,
‘C:\Users\12892\Documents\Python for Finance\project-5-gold-medal-metrics-start\node_modules\sqlite3\lib\sqlite3.js’,
‘C:\Users\12892\Documents\Python for Finance\project-5-gold-medal-metrics-start\server.js’
]

I’ve scoped the forums and updated several packages on npm. This includes SQlite. Despite trying the suggestions on others posts, I still run into the same issue.

2 Likes

I’m also lost on getting this project to load data into the browser. I follow the directions to start the server and it hands me the Module Not Found error above. All of my SQL is correct according to the testing module and I get the same error trying to launch a server on the solution code. Does anyone know why we might not be able to get the server running?

My index.html file loads a page with all HTML, CSS, JavaScript intact but appears to fail to load any actual data. Previously I had been getting a message in the terminal that said ‘Data compiled successfully’ but same result. After trying to re-install or update Node.js I’m getting this Module Not Found error. Any help would be appreciated.

Is this thread helpful at all? Cumulative Project: Gold Medal Metrics- What's going on? - #3 by karlj.38

I believe this project has some serious issues. I had to remove the sqlite3 package and re-install. Also manually remove the old package.json line referring to sqlite.
Now the packages seem to work but the sqlite table is empty. I get:

Country table not found!
[Error: SQLITE_ERROR: no such table: Country] {
  errno: 1,
  code: 'SQLITE_ERROR'
}
GoldMedal table not found!
[Error: SQLITE_ERROR: no such table: GoldMedal] {
  errno: 1,
  code: 'SQLITE_ERROR'
}
Data successfully loaded

no pls help !
I desperately need help !

following worked for me !

  1. I have reinstalled node with all other things it install additionally
  2. visual studio 2019
  3. npm update

and got it working
now it install express and not throwing error !
everything works as it should be !

node.js - NPM Install Error - Node-Pre-Gyp - Stack Overflow
node-gyp - npm

feeling great :star_struck: :money_mouth_face:

Hi @annestuart
I had the same issue but I believe these errros are part of the project. If you read the instructions they say:
Returns the SQL command that will create a table, named Country with the following columns:

createGoldMedalTable

Returns the SQL command that will create a table, named GoldMedal with the following columns:
So both tables (Country and Gold Medal) do not exist hence the error you see.

Yes, I had to delete the line in the package json about sqlite3 and run npm install sqlite3 and then it worked.

1 Like

Thank you for adding this note @mleguizamon, it was exactly what I needed! I just spent the last 2 hours on StackOverflow/npm docs/Google trying to figure this out (for the second time as I gave up on a different project that had this same dependency issue months ago lol). I even uninstalled and reinstalled Node.js with chocolatey and that didn’t work.

In the end, all I needed to do was delete the reference to sqlite3 in my package.json and then run npm install sqlite3 in the project’s root folder.

Thanks a million! So happy to be able to move on with this project now.