我的问题是如何运行用ES6编写的sequelize migrations / seeds?
我尝试使用babel-node,但得到了奇怪的错误
命令
node_modules/babel-cli/lib/babel-node.js node_modules/sequelize-cli/bin/sequelize db:seed
错误
node_modules/babel-cli/lib/babel-node.js: line 1: /Applications: is a directory
node_modules/babel-cli/lib/babel-node.js: line 3: /Applications: is a directory
node_modules/babel-cli/lib/babel-node.js: line 4: 127.0.0.1: command not found
node_modules/babel-cli/lib/babel-node.js: line 5: syntax error near unexpected token `('
node_modules/babel-cli/lib/babel-node.js: line 5: ` * when found, before invoking the "real" _babel-node(1) executable.'
最佳答案 试试这个配置:
https://gist.github.com/andrewmunro/030f0bf62453239c495b0347c8cd1247.
它对我有用.