0
使用pgAdmin4在Windows 10计算机上运行我的Express项目。Postgres方言无法正常工作
在sequelize/config.json
文件与postgres方言,Sequelize给出了一些错误。
"development": {
"username": "root",
"password": null,
"database": "database_development",
"host": "127.0.0.1",
"port": "5432",
"dialect": "postgres"
}
但随着sqlite的方言,它工作正常。
"development": {
"dialect": "sqlite",
"storage": "./db.development.sqlite"
}
运行gulp watch
与Postgres的话,下面的错误上来:
$ gulp watch
[22:00:43] Using gulpfile ~\friendly-stuff\gulpfile.js
[22:00:43] Starting 'build'...
[22:00:43] Starting 'clean'...
[22:00:43] Finished 'clean' after 28 ms
[22:00:43] Starting 'stylus'...
[22:00:43] Finished 'stylus' after 101 ms
[22:00:43] Finished 'build' after 132 ms
[22:00:43] Starting 'server:start'...
[22:00:43] Finished 'server:start' after 10 ms
[22:00:43] Starting 'watch'...
[22:00:43] Finished 'watch' after 20 ms
[22:00:44] Development server listening. (PID:12632)
Mon, 19 Sep 2016 02:00:44 GMT friendly-stuff:server Listening on port 3000
Unhandled rejection SequelizeConnectionRefusedError:
connect ECONNREFUSED 127.0.0.1:5432 at
C:\Users\user1\MyProj\node_modules\sequelize\lib\dialects\
postgres\connection-manager.js:98:20 at Connection.
我觉得有一些其他的配置需要添加或更改。但我不确定哪一个。你认为我使用的widows/pgadmin版本是否会导致这些错误或windows 10防火墙/安全性阻塞端口?
我猜中了这一次!我在安装'pg'时没有使用'--save',我还通过关闭Windows防火墙并以管理员身份运行它来重新安装pgAdmin4。我发现'protocol'是可选的,它可以工作在无线协议上,但我只是为了以防万一。不过谢谢你,我想不到这样做。 – mhasan