sh:第1行:5751分段错误sequelize db:migrate(Node.js + Sequelize + Postgresql)

时间:2019-06-25 05:40:57

标签: node.js postgresql segmentation-fault sequelize.js

运行sequelize db:migrate会导致弹性beantalk中的分段错误。

-------------------------------------
/var/log/nodejs/nodejs.log
-------------------------------------
> sequelize db:migrate && node server.js


[4mSequelize CLI [Node: 10.16.0, CLI: 5.4.0, ORM: 5.8.7][24m

Loaded configuration file "sequelize/config/config.js".
Using environment "production".
sh: line 1: 10118 Segmentation fault      sequelize db:migrate
npm ERR! code ELIFECYCLE
npm ERR! errno 139
npm ERR! code@1.0.0 start: `sequelize db:migrate && node server.js`
npm ERR! Exit status 139
npm ERR! 
npm ERR! Failed at the timeline_api@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

> code@1.0.0 start /var/app/current
> sequelize db:migrate && node server.js
-------------------------------------

1 个答案:

答案 0 :(得分:0)

问题与软件包pg-native有关。切换pg解决了此问题。

// Sequelize config
 production: {
    ...
    // or don't set this value.
    native: false,
    ...
  },

该问题似乎也与节点版本有关。假设它不适用于node 10(需要进一步说明)。 来源:

https://github.com/brianc/node-pg-native/issues/71

https://github.com/brianc/node-pg-native/issues/70