ReferenceError: sqlite3 is not defined

I’m currently working on the cumulative project “Expresso”, but I keep getting the error “ReferenceError: sqlite3 is not defined” when trying to run the tests (see output below).
sqlite3 is available on my windows machine and I’ve defined an alias “sqlite3” which works from my git-bash terminal (I followed the steps in https://www.codecademy.com/paths/web-development/tracks/sql-for-web-development/modules/setting-up-sqlite/articles/what-is-sqlite.

Can anybody help me out please.

$ npm test

> expresso@1.0.0 test C:\Dev\Codecademy\expresso
> mocha

C:\Dev\Codecademy\expresso\node_modules\yargs\yargs.js:1163
      else throw err
           ^

ReferenceError: sqlite3 is not defined
    at Object.<anonymous> (C:\Dev\Codecademy\expresso\api\menus.js:4:12)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Dev\Codecademy\expresso\api\api.js:3:21)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Dev\Codecademy\expresso\server.js:6:19)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Dev\Codecademy\expresso\test\test.js:8:13)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at C:\Dev\Codecademy\expresso\node_modules\mocha\lib\mocha.js:334:36
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (C:\Dev\Codecademy\expresso\node_modules\mocha\lib\mocha.js:331:14)
    at Mocha.run (C:\Dev\Codecademy\expresso\node_modules\mocha\lib\mocha.js:809:10)
    at Object.exports.singleRun (C:\Dev\Codecademy\expresso\node_modules\mocha\lib\cli\run-helpers.js:108:16)
    at exports.runMocha (C:\Dev\Codecademy\expresso\node_modules\mocha\lib\cli\run-helpers.js:142:13)
    at Object.exports.handler (C:\Dev\Codecademy\expresso\node_modules\mocha\lib\cli\run.js:292:3)
    at Object.runCommand (C:\Dev\Codecademy\expresso\node_modules\yargs\lib\command.js:242:26)
    at Object.parseArgs [as _parseArgs] (C:\Dev\Codecademy\expresso\node_modules\yargs\yargs.js:1104:24)
    at Object.parse (C:\Dev\Codecademy\expresso\node_modules\yargs\yargs.js:566:25)
    at Object.exports.main (C:\Dev\Codecademy\expresso\node_modules\mocha\lib\cli\cli.js:68:6)
    at Object.<anonymous> (C:\Dev\Codecademy\expresso\node_modules\mocha\bin\mocha:164:29)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
npm ERR! Test failed.  See above for more details.

1 Like

npm start solved problem… thanks

1 Like