Full Stack Path: Acme Bank Security Project: MODULE_NOT_FOUND error

Hello All,

I am experiencing a problem when I try to get started with this project. I am on a Mac, and installed sqlite3 and DB Browser. I opened the file in VS Code, and one of the first instructions is to type in ‘node app’, in order to get the app running. I then receive the error of ‘MODULE_NOT_FOUND’. Please see the stack trace below:
sungketpatel|11:12:11|Acme Bank|0|$ node app
node:internal/modules/cjs/loader:1080
throw err;
^

Error: Cannot find module ‘/Users/sungketpatel/Projects/Acme Bank/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node’
Require stack:

  • /Users/sungketpatel/Projects/Acme Bank/node_modules/sqlite3/lib/sqlite3-binding.js
  • /Users/sungketpatel/Projects/Acme Bank/node_modules/sqlite3/lib/sqlite3.js
  • /Users/sungketpatel/Projects/Acme Bank/app.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object. (/Users/sungketpatel/Projects/Acme Bank/node_modules/sqlite3/lib/sqlite3-binding.js:4:15)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions…js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘/Users/sungketpatel/Projects/Acme Bank/node_modules/sqlite3/lib/sqlite3-binding.js’,
    ‘/Users/sungketpatel/Projects/Acme Bank/node_modules/sqlite3/lib/sqlite3.js’,
    ‘/Users/sungketpatel/Projects/Acme Bank/app.js’
    ]
    }

Node.js v18.16.1

Can anybody help and see what is going on?

Thanks in advance,
Sungket

Something is wrong with your node’s setup for sqlite3.

Did you ever install it, if so you might need to uninstall and reinstall it.
I don’t know what package manager you’re using (npm, yarn, etc)

but you might do a command like

$ npm install sqlite3

on your terminal or powershell etc.

2 Likes

This fixed the issue for me, thank you!