在node.js中使用繁琐的getaddrinfo ENOTFOUND

我试图连接到本地SQL Express服务器使用Tedious,但不断得到

failed Error: getaddrinfo ENOTFOUND 

我在这里使用错误的地址?

  var Connection = require('tedious').Connection; var config = { userName: 'sa', password: 'mypassword', server: 'LOCALHOST\\SQLEXPRESS', }; var connection = new Connection(config); connection.on('connect', function(err) { // If no error, then good to go... if(err) { console.log(err); return; } executeStatement(); } ); 

“不支持Microsoft样式的主机名\实例名string” – pekim

我在github上发布了相同的问题,这里是完整的答案: https : //github.com/pekim/tedious/issues/118