sunyang3721 can you describe your use case in more detail ?
Flarum's backend is written in PHP and will remain so in 2.x.
However there's no reason you can't have a frontend extension interact with a different backend for some features. You could have a NodeJS app interact with Flarum through API requests, or by having PHP start NodeJS processes behind the scenes.
My mithril2html extension for example starts a headless Chrome instance behind the scenes using pupetteer. My scratchpad extension compiles javascript code automatically using Webpack, all started from PHP.
Of course if you intend to publish your extension to the public, the NodeJS or shell exec requirement might be a big deal breaker for users on simple hostings.