Require introduces a problem. There is an error in var mysql = require ('mysql) in js. Ask for advice.

problem description: there is an existing js project. Require ("mysql") works normally in the server written by node. Why does using require (" mysql") in your new js throw a require is not define error

expectation: want to use node to encapsulate mysql add, delete, modify and query statements, and call

in any js.

ask for advice

Dec.16,2021
Menu