First, forget that getChildByName exists, for your own good. I’m arguing with my coworkers right now about the amount of trouble that it brings…
So, the easiest way to do what you are trying to do is reference the script directly instead of the node. To do so, in the beginning of the file, do a node-like require. You can require just by the file’s name, but insert the path is a good practice for future maintenance.
and, in your code, you access the instance directly
this.popupManager.doStuff();
Another way to do it is keep the cc.Node type in properties, and access it by getting the component, like you tried to do, it has it’s applications, but for you case, the above would be better
var popupManager = this.popupLayer.getComponent(PopupManager);