Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install sqlite3 --save, Cannot find module 'sqlite3' #1

Open
ravinaNG opened this issue Jan 21, 2020 · 0 comments
Open

npm install sqlite3 --save, Cannot find module 'sqlite3' #1

ravinaNG opened this issue Jan 21, 2020 · 0 comments

Comments

@ravinaNG
Copy link
Owner

ravinaNG commented Jan 21, 2020

I have cloned the project from "https://github.com/hassanamin994/videowiki-test-task" and then started code in MVC style and I have installed MySQL, knex, express, body-parser, etc whatever is required but I am getting sqlite3 error.

don't understand why?

index.js

const app = express();
app.use(express.json());

const signUp = require('../routs/blogApp');
app.use('/signUp', signUp);

app.listen(6000, () =>{
    console.log('Now server is active...');
}); 

model one


const signUp = (data) => {
    return knex('user_details').insert(data);
};

module.exports = {signUp};

routs one

const router = express.Router();
// const jwt = require('jsonwebtoken');
const blogAppDB = require('../model/blogAppDB')

router.post('/signUp', (req, res) => {
    const data = {
        "user_name": req.body.user_name,
        "email_address": req.body.email_address,
        "password": req.body.password
    }
    const postedData = blogAppDB.signUp(data);
    postedData.then((resp) => {
        res.json(resp);
    })
    .catch((err) => {
        console.log(err);
        res.send(err);
    })
})

module.exports = router;

knexFile-

    client: 'mysql',
    connection: {
        host: 'localhost',
        user: 'root',
        password: 'myPassword',
        database: 'videowiki'
    }
});

module.exports = knex;

can anyone help me with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant