It has nothing to do with classes, but rather ES6 modules, vs NodeJS Common Modules. Luckily, Create React App will use babel underneath to transpile ES6 import statements.
Essentially turn your var foo = require('bar')
statements into import foo from 'bar';
SO:
var app = require('express')(),
cookieParser = require('cookie-parser'),
jwt = require('jsonwebtoken'),
passport = require('passport'),
OAuth2Strategy = require('passport-oauth').OAuth2Strategy,
fs = require('fs');
Should be
import express from 'express';
import cookieParser from 'cookie-parser';
import jwt from 'jsonwebtoken';
import passport from 'passport';
import { OAuth2Strategy } from 'passport-oauth';
import fs from 'fs';
const app = express();
This assumes you have those npm modules already installed.
IIRC, Create React App ONLY creates a the front-end application. PassportJS is designed to be used in a middle-tier/backend, like an express app. You'll need to create an express app, and mount the passportjs middleware inside the express app.