title: DeprecationWarning: timers.unenroll() is deprecated. Please use clearTimeout instead
body: <p>While following this youtube <a href="https://www.youtube.com/watch?v=HPIjjFGYSJ4" rel="nofollow noreferrer">video</a> to learn about node.js </p>
  
  <p>I got this error</p>
  
  <blockquote>
    <p>$ nodemon index.js<br>
    (node:18129) [DEP0096] DeprecationWarning: timers.unenroll() is deprecated. Please use clearTimeout instead.</p>
  </blockquote>
  
  <p>App server still able to run. However as I am trying to add router to add item as the video, it never go through successfully. However, I would call it half- successfully as I do see the data log in the terminal but never go back to database. as you can see, we can see xxx as name as  40 as price in the terminal after I queried </p>
  
  <pre><code>http://localhost:4000/products/add?name=xxx&amp;price=40
  </code></pre>
  
  <p>in the browser as in the video around 10:52. (I got it working after hard-coding in the index.js file. Why can't I query it as the video did? ) I am assuming the timers.unenorll() causing this. but i Googled it, all i find is this <a href="https://nodejs.org/api/deprecations.html#deprecations_dep0096_timers_unenroll" rel="nofollow noreferrer">one</a>, and this <a href="https://nodejs.org/en/blog/release/v10.0.0/" rel="nofollow noreferrer">one</a>(on <a href="https://nodejs.org/en/blog/release/v10.0.0/" rel="nofollow noreferrer">https://nodejs.org/en/blog/release/v10.0.0/</a> page)</p>
  
  <p><a href="https://i.stack.imgur.com/AxDQU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AxDQU.png" alt="enter image description here"></a> </p>
  
  <p>but don't know what to do with it. cant' find a solution.please help</p>
  
  <pre><code>$ node -v
  v10.0.0
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YYti9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YYti9.png" alt="enter image description here"></a> </p>
  
  <pre><code>const express = require('express');
  const cors = require('cors');
  const mysql = require('mysql');
  
  const app = express();
  
  app.use(cors());
  
  const SELECT_ALL_PRODUCT_QUERY = 'SELECT * FROM products';
  
  const connection = mysql.createConnection({
    host: 'localhost',
    user: 'genius',
    password: 'genius',
    database: 'react_sql'
  });
  
  connection.connect(err =&gt; {
    if(err) {
      return err;
    }
  });
  
  console.log(connection);
  
  
  app.get('/',(req, res) =&gt; {
    res.send('go to /products to see the genius gyms')
  });
  
  app.get('/products/add', (req, res) =&gt; {
    const {name, price} = req.query;
    //console.log(name, price); 
    const INSERT_PRODUCTS_QUERY = `INSERT INTO products(name, price) VALUES('${name}',${price})`;
    connection.query(INSERT_PRODUCTS_QUERY,(err, results) =&gt; {
      if(err) {
        return res.send(err)
      } else {
        return res.send('successfully added product')
      }
  
    });   
    });
  
  
  
  
  app.get('/products', (req, res) =&gt; {
    connection.query(SELECT_ALL_PRODUCT_QUERY,(err,results) =&gt; {
      if(err) {
        return res.send(err)
      }
      else {
        return res.json({
          data: results
        })
      }
    });
  });
  
  
  app.listen(4000,() =&gt; {
      console.log(`Genius gyms listening on
      port 4000`)
  
  
  }); 
  </code></pre>