Locally developed NPM Package not running in production enviornment

I have developed a plugin for peertube to restrict all user to force login. I have tested this plugin in local environment and is working fine. The repository for plugin is Smile Kisan / peertube-plugin-force-login · GitLab. I am trying to install it in production environment before releasing it in npm packages. In the plugin i have checked the url using hook

'action:router:navigation-end'

In local environment, if the user is not authorized he/she is redirected to login page. But when i install the plugin in production environment for testing, the hook is not getting triggered and seems like plugin is not working as it is in local environment. Can you please provide me any ideas about this? @Chocobozzz & @JohnLivingston ??