Codestrips project - error when try to run node sqlite (step 9)

Hello,

I arrived to step 8 successfully (Codestrips project), but then in 9, when I try to run ‘node sqlite’ I get the error message:
“throw er; // Unhandled ‘error’ event

Error: SQLITE_CANOPEN: unable to open database file”.

Can anybody help me?

https://www.codecademy.com/paths/web-development/tracks/building-a-persistent-api/modules/persistent-api-cumulative-projects/projects/codestrips-prj

// code at app.js
const express = require(‘express’);
const app = express();
const bodyParser = require(‘body-parser’);
const morgan = require(‘morgan’);

const PORT = process.env.PORT || 4001;

app.use(express.static(‘public’));
app.use(morgan(‘dev’))
app.use(bodyParser.json())

app.listen(PORT, () => {
console.log(Server is listening on port: ${PORT})
})

module.exports = app;

// and code at sql.js
const db = new sqlite3.Database(’/db.sqlite’);

db.serialize(() => {
db.run(DROP TABLE IF EXISTS Strip);
db.run(CREATE TABLE IF NOT EXISTS Strip( id INTEGER PRIMARY KEY, head TEXT NOT NULL, body TEXT NOT NULL, background TEXT NOT NULL, bubble_type TEXT NOT NULL, bubble_text TEXT NOT NULL DEFAULT "", caption TEXT NOT NULL DEFAULT "" ))
});

Thanks in advance, Fernando

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.