小编Mar*_*ior的帖子

postgres 与 node.js 连接时发生 SASL 错误

尝试连接到数据库时出现以下错误:

\n
Conex\xc3\xa3o estbabelecida com sucesso\nAcessar http://localhost:3000\nServidor executando na porta 3000\nC:\\Users\\lopes\\Desktop\\Javascript\\novo-projeto\\ExpressEWebpack\\node_modules\\pg\\lib\\sasl.js:24\n    throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string')\n    ^\n\nError: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string\n    at Object.continueSession (C:\\Users\\lopes\\Desktop\\Javascript\\novo-projeto\\ExpressEWebpack\\node_modules\\pg\\lib\\sasl.js:24:11)\n    at Client._handleAuthSASLContinue (C:\\Users\\lopes\\Desktop\\Javascript\\novo-projeto\\ExpressEWebpack\\node_modules\\pg\\lib\\client.js:257:10)\n    at Connection.emit (events.js:315:20)\n    at C:\\Users\\lopes\\Desktop\\Javascript\\novo-projeto\\ExpressEWebpack\\node_modules\\pg\\lib\\connection.js:114:12\n    at Parser.parse (C:\\Users\\lopes\\Desktop\\Javascript\\novo-projeto\\ExpressEWebpack\\node_modules\\pg-protocol\\dist\\parser.js:40:17)\n    at Socket.<anonymous> (C:\\Users\\lopes\\Desktop\\Javascript\\novo-projeto\\ExpressEWebpack\\node_modules\\pg-protocol\\dist\\index.js:11:42)\n    at Socket.emit (events.js:315:20)\n    at addChunk (internal/streams/readable.js:309:12)\n    at readableAddChunk (internal/streams/readable.js:284:9)\n    at Socket.Readable.push (internal/streams/readable.js:223:10)\n[nodemon] app crashed - waiting for file changes before starting...\n
Run Code Online (Sandbox Code Playgroud)\n

这是我的连接代码

\n
require('dotenv').config();\nconst express = require('express');\nconst app = express(); \nconst { …
Run Code Online (Sandbox Code Playgroud)

javascript database postgresql connection node.js

6
推荐指数
1
解决办法
8965
查看次数

标签 统计

connection ×1

database ×1

javascript ×1

node.js ×1

postgresql ×1