can shader be set to node ,not nodepath

To set a shader on a PandaNode object instead of a NodePath object, you can use:

node.setAttrib(ShaderAttrib.make(shader))

This is essentially what NodePath.setShader does under the hood.

The rest of your question makes it sound like you want to apply a shader on a specific node whereas you want to use a different shader for other nodes. This is simply a matter of finding the NodePath of the subnode, then calling setShader on it. This will automatically override a shader applied to a higher node.