Exercise "cumulative Project:codestrips" I get "ReferenceError: Cannot access 'sqlite3' before initialization" in Express Persistent API Step 17

Hi,

I get the above error when I run node migration.js . The coding I have in migration.js is

const sqlite3 = require(‘sqlite3’);

const db = new sqlite3.Database(’./database.sqlite’)

db.serialize(function() {

db.run(‘CREATE TABLE IF NOT EXISTS Artist(’ +

id INTEGER NOT NULL,’ +

name TEXT NOT NULL,’ +

date_of_birth TEXT NOT NULL,’+

biography TEXT NOT NULL,’ +

is_currently_employed INTEGER NOT NULL DEFAULT 1’ +

‘PRIMARY KEY(id)’

);

});

I’ve also noticed that the package.json file does not have as dependencies, morgan, errorHandler or cors. I ran npm install to start the project, and then ran it again when I noticed they weren’t there. both times these were not included.

Can you help?

I think there were some issues with node version on this project. I ended up using an older version (8.9.3) for that project and some of the other back-end projects. If you are on a later node (such as 12 or 14) I would try installing 8.9.3, then switching to that with nvm and installing the project in a new directory. Then copy code over there and see if you have better luck. You should not have any major errors when installing the project.