sails.js - 在开发模式下连接 Sails 应用程序中的 postgres 时出现超时错误?
问题描述
我正在尝试使用sails框架开发一个简单的HTTP API。我已经创建了模型、控制器、助手和路由以完成 API 的工作流程,但是当我在开发模式下提升帆应用程序时,设置 migrate=alter 时出现超时错误。在我自己调试之后,我得出的结论是我的sails 应用程序没有与postgres 连接。
我已经安装了所有相关的依赖项(例如sails -postgresql、pg等),我在 config.model 文件中设置了正确的 URL。我不知道我错过了什么..有什么建议吗???
版本:sails-1.2.4、postgresql-12.4
编辑:这是我得到的错误。
nirajrajput@Nirajs-MacBook-Pro demosails % node app.js
(node:29522) Warning: Accessing non-existent property 'padLevels' of
module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was
created)
info: ·• Auto-migrating... (alter)
info: Hold tight, this could take a moment.
error: Failed to lift app: Error: Sails is taking too long to load.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- --
Troubleshooting tips:
-• Were you still reading/responding to an interactive prompt?
(Whoops, sorry! Please lift again and try to respond a bit more
quickly.)
-• Do you have a lot of stuff in `assets/`? Grunt might still be
running.
(Try increasing the hook timeout. Currently it is 40000.
e.g. `sails lift --hookTimeout=80000`)
-• Is `blueprints` a custom or 3rd party hook?
(*If* `initialize()` is using a callback, make sure it's being
called.)
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- --
at Timeout.tooLong [as _onTimeout] (/Users/nirajrajput/demosails/node_modules/sails/lib/app/private/loadHooks.js:191:21)
at listOnTimeout (internal/timers.js:551:17)
at processTimers (internal/timers.js:494:7)
解决方案
推荐阅读
- c++ - 使用 boost 进行标记会产生相同的输出
- c# - C# Elvis 运算符可为空的布尔值
- html - 使用动画将图像添加到 svg 形状
- javascript - 将数据从 REST API 加载到 EXT JS 表单的选择字段
- vue.js - 将数据从 Vue 实例传递到本地 Vue 组件
- google-cloud-platform - 如何查看 Cloud SQL Admin API 的日志?
- java - 将 CSV 文件与 Neo4j 结果进行比较
- xml - 使用 Spring Batch 进行 Zip 压缩
- regex - 如何从一行中排除指定字符?
- angular - 角。从 switchMap 内的订阅中获取价值