title: TypeError: dotenv.load is not a function in angular 8
body: <p>Error: </p>
  
  <pre class="lang-js prettyprint-override"><code> /Users/nhannguyen/Desktop/spotify_project/server.js:8
       dotenv.load();
              ^
  
   TypeError: dotenv.load is not a function
       at Object.&lt;anonymous&gt; (/Users/nhannguyen/Desktop/spotify_project/server.js:8:12)
       at Module._compile (internal/modules/cjs/loader.js:1147:30)
       at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
       at Module.load (internal/modules/cjs/loader.js:996:32)
       at Function.Module._load (internal/modules/cjs/loader.js:896:14)
       at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
       at internal/main/run_main_module.js:17:47
  </code></pre>
  
  <p>Code: </p>
  
  <pre class="lang-js prettyprint-override"><code>const express = require("express");
  const cors = require('cors');
  const dotenv = require('dotenv');
  const querystring = require('querystring');
  const request = require('request');
  
  if (process.env.NODE_ENV !== 'production') {
    dotenv.load();
  }
  
  const app = express();
  
  app.use(cors());
  // Setting
  app.use(express.static(__dirname + "/spotify/dist/spotify"));
  
  app.use(express.json());
  app.use(
    express.urlencoded({
      extended: true,
    })
  );
  
  app.get('/login', (req, res) =&gt; {
    res.redirect('https://accounts.spotify.com/authorize?' +
      querystring.stringify({
        response_type: 'code',
        client_id: process.env.SPOTIFY_CLIENT_ID,
        scope: 'user-read-private user-read-email user-top-read playlist-modify-public playlist-modify-private',
        redirect_uri: process.env.REDIRECT_URI
      }));
  });
  
  app.get('/callback', (req, res) =&gt; {
    const code = req.query.code || null;
  
    const authOptions = {
      url: 'https://accounts.spotify.com/api/token',
      form: {
        code: code,
        redirect_uri: process.env.REDIRECT_URI,
        grant_type: 'authorization_code'
      },
      headers: {
        'Authorization': 'Basic ' + (new Buffer.from(
          process.env.SPOTIFY_CLIENT_ID + ':' + process.env.SPOTIFY_CLIENT_SECRET
        ).toString('base64'))
      },
      json: true
    };
  
    request.post(authOptions, (error, response, body) =&gt; {
      const access_token = body.access_token;
      const uri = process.env.FRONTEND_URI;
      res.redirect(uri + '?access_token=' + access_token);
    });
  });
  
  require("./server/config/routes.js")(app);
  
  // Localhost
  app.listen(8000);
  </code></pre>
  
  <p>I am trying to get authorization with <code>Spotify API</code>. </p>