0

When I type var mysql=require('mysql');, I get an error that mysql module is not found.

In which folder of node.js should MySQL be placed? Should the entire MySQL folder be placed?

1 Answer 1

1

I'm not quite sure what mysql folder you are talking about but I would recommend just using npm for this and letting it handle the installation of the package.

Simply go into the folder of your project and install the MySQL Module using npm install mysql.

You can read more about using and installing the MySQL Module here.

Sign up to request clarification or add additional context in comments.

1 Comment

When i put npm install mysql, few packages get added but in nodejs when u type "var mysql =require('mysql');" ,i get an error that the module isn't found. what do u think is the mistake? By folder i meant the node js folder which contains node_modules and all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.