在我的节点js中,requre函数不起作用

时间:2018-08-03 12:38:47

标签: html node.js node-modules

var express = require('express');
var mysql = require('mysql');
var app = express();

var connection = mysql.createConnection({
  host: 'localhost',
  user: 'your_user',
  password: 'some_secret',
  database: 'the_app_database'
});

connection.connect(function(err) {
  if (err) throw err
  console.log('You are now connected...')
});

我是nodejs的新手。在我的nodejs项目中,requre函数无法正常工作吗?我不能添加jQuery或任何其他东西。为什么要求不能正常工作。无法连接到数据库mysql

是什么问题?

0 个答案:

没有答案
相关问题