0
var GoogleStrategy = require('passport-google-oauth20').Strategy;

How can I use ES2017's way to write it? I try

import GoogleStrategy from ('passport-google-oauth20').Strategy

But it couldn't work

How can I use ES7 to write it? Thanks

here is the package.json file, It set the type as module. So I couldn't use const...=require('...')

{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "start": "nodemon index.js"
  },

1 Answer 1

0
import { Strategy } from 'passport-google-oauth20';
Sign up to request clarification or add additional context in comments.

1 Comment

It’s import { Strategy as GoogleStrategy } from 'passport-google-oauth20';.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.