title: Getting ERROR: Error parsing url: undefined when trying to run migrations with Sequelize
body: <p>I'm creating a Node.js/Express.js app with Sequelize as my ORM. <a href="https://scotch.io/tutorials/getting-started-with-node-express-and-postgres-using-sequelize" rel="nofollow noreferrer">This is the tutorial I'm following.</a> I'm having trouble migrating my tables onto my Azure SQL database.</p>
  
  <p>My <code>config/config.json</code> file is as such:</p>
  
  <pre><code>{
      "development" : {
         "use_env_variable" : "DATABASE_URL",
         "dialect" : "mssql"
      }
  }
  </code></pre>
  
  <p>My <code>.env</code> file is as such:</p>
  
  <p><code>DATABASE_URL=&lt;connection string here&gt;</code></p>
  
  <p>These are being called by this code in <code>models/index.js</code>:</p>
  
  <pre><code>'use strict';
  
  var fs        = require('fs');
  var path      = require('path');
  var Sequelize = require('sequelize');
  var basename  = path.basename(module.filename);
  var env       = process.env.NODE_ENV || 'development';
  var config    = require(__dirname + '/../config/config.json')[env];
  var db        = {};
  
  if (config.use_env_variable) {
    var sequelize = new Sequelize(process.env[config.use_env_variable]);
  } else {
    var sequelize = new Sequelize(config.database, config.username, config.password, config);
  }
  </code></pre>
  
  <p>I have <code>require('dotenv').config()</code> in my main file <code>app.js</code>. My understanding was that the <code>dotenv</code> package exports all of my <code>.env</code> variables throughout my project. </p>
  
  <p>When I try running <code>node_modules/.bin/sequelize db:migrate</code> in the terminal, I get </p>
  
  <p><code>ERROR: Error parsing url: undefined</code></p>
  
  <p>Why is it coming back as undefined?</p>
  
  <p>Here is my file structure in case it helps. </p>
  
  <p><a href="https://i.stack.imgur.com/lnfo7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lnfo7.jpg" alt="enter image description here"></a></p>