[Help] Module parse failed: Unexpected token . Babel not working correctly

npm install and make get many similar errors like the following.

ERROR in ./node_modules/react-native/Libraries/Animated/src/Easing.js 64:16
    Module parse failed: Unexpected token (64:16)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
    |    * A stepping function, returns 1 for any positive value of `n`.
    |    */
    >   static step0(n: number): number {
    |     return n > 0 ? 1 : 0;
    |   }

The errors looks like babel did not work for node_modules/react-native/Libraries .
I got no errors with stable_6433, but we’re building features branching from stable.

My babel.config.js stays the same with 6433 and not using .babelrc.
I found .flowconfig was removed from master branch. Is it relevant ?

already using @babel/preset-env, @babel/preset-flow, @babel/preset-react
need to add more plugins to webpack.config.js ?

Delete node_modules folder and try again, make sure you use latest LTS versions for node and npm.

What version of node, npm are you using?

Yes. i’ve cleaned up everything from the beginning.

git clone https://github.com/jitsi/jitsi-meet.git
git checkout stable/jitsi-meet_6433
npm install

using node v12.22.9 and npm 6.14.15

Add only 1 line

import { NativeModules } from 'react-native';

on top of the file react/features/base/participants/middleware.js
where we’d like to do extra password feature via NativeModules.ExternalAPI.sendEvent

but make failed after adding the first line.

Is it causing circle import ?

You need node 16 and npm 8

stable 6433 is an older release (package.json says node >=8 and npm >=6)
I’ve tried node 14 and npm 6 still make failed.

This is wrong, adding react native code in a part executed by web and mobile