Guyz, encontré una respuesta a mi problema,
en modelos/index.js
Cambio process.env.NODE_ENV a procesar.env.NODE_ENV.trim()
'use strict';
const fs = require('fs');
const path = require('path');
const Sequelize = require('sequelize');
const basename = path.basename(__filename);
// Before
const env = process.env.NODE_ENV || 'development';
// After
const env = process.env.NODE_ENV.trim() || 'development'; // add .trim()
const config = require(__dirname + '/../config/config.js')[env];
const db = {};
let sequelize;
if (config.use_env_variable) {
sequelize = new Sequelize(process.env[config.use_env_variable], config);
} else {
sequelize = new Sequelize(config.database, config.username, config.password, config);
}
...
db.sequelize = sequelize;
db.Sequelize = Sequelize;
module.exports = db;
paquete.json
"scripts": {
"db:migrate:dev": "sequelize db:migrate --env development",
"db:migrate:test": "sequelize db:migrate --env test",
"db:migrate:production": "sequelize db:migrate --env production",
"db:reset": "sequelize db:migrate:undo",
"start": "SET NODE_ENV=production && babel-watch server/server.js",
"dev": "SET NODE_ENV=development && babel-watch server/server.js",
"test": "SET NODE_ENV=testing && babel-watch server/server.js"
}
Ejemplo , Digamos que inicio el servidor escribiendo en la terminal
npm run dev
If i do console.log(process.env.NODE_ENV) // output is "development " with a space.
Hence,
process.env.NODE_ENV === "development" // return false
or
"development " === "development" // return false
Javascript Trim () elimina los espacios en blanco de ambos lados de una cadena
¿Quieres más recursos? visite w3c