title: Why I got "sequelize.literal is not a function" in Sequelize
body: <p>I try to clone my project to new PC then I got an error call "sequelize.literal is not a function".</p>
  
  <p>This is my product controller. I try to get my product with avg_rating by using literal function.</p>
  
  <pre><code>const Product = require("../models").product;
  
  module.exports = {
  getProduct: async (req, res) =&gt; {
    try {
      let query = {}
      query.where = {
          isPublished: 1
      };
      query.attributes = {
        include: [
          sequelize.literal(
            `(SELECT CAST(AVG(rating) AS DECIMAL(10,1)) FROM product_reviews WHERE productId = \`Product\`.\`id\`)`
          ),
          "avg_rating",
        ]
      }
  
      const product = await Product.findAll(query)
  
      res.send({
        status: 200,
        data: product,
      });
  
    } catch (error) {
      res.status(500).send({
        error: error.message,
      });
    }
  },
  }
  
  </code></pre>
  
  <p>For the result  </p>
  
  <blockquote>
    <p>Status 500 &amp; error: "sequelize.literal is not a function"</p>
  </blockquote>
  
  <p>My package.json here.</p>
  
  <pre><code>{
    "name": "backend",
    "version": "1.0.0",
    "description": "",
    "main": "app.js",
    "scripts": {
      "dev": "nodemon app.js"
    },
    "author": "NuChaiyakorn",
    "license": "ISC",
    "dependencies": {
      "bcryptjs": "^2.4.3",
      "body-parser": "^1.19.0",
      "cookie-session": "^1.4.0",
      "cors": "^2.8.5",
      "dotenv": "^8.2.0",
      "express": "^4.17.1",
      "express-fileupload": "^1.1.7-alpha.3",
      "express-promise-router": "^3.0.3",
      "faker": "^4.1.0",
      "ffmpeg": "0.0.4",
      "joi": "^14.3.1",
      "jsonwebtoken": "^8.5.1",
      "morgan": "^1.10.0",
      "mysql2": "^2.1.0",
      "passport": "^0.4.1",
      "passport-jwt": "^4.0.0",
      "passport-local": "^1.0.0",
      "ramda": "^0.27.0",
      "randomstring": "^1.1.5",
      "sequelize": "^5.21.6",
      "slugify": "^1.4.0"
    }
  }
  </code></pre>