Cannot read property ‘push’ of undefined in express [Solved]

   this.stack.push(layer);

             ^

TypeError: Cannot read property ‘push’ of undefined

const routers = require(‘express’).Router;
change to below

const routers = require(‘express’).Router();

Leave a Comment

Your email address will not be published. Required fields are marked *