Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript I';我在Auth0';s节点包,特别是在其AuthenticationClient和ManagementClient API中_Javascript_Node.js_Typescript_Auth0_Nestjs - Fatal编程技术网

Javascript I';我在Auth0';s节点包,特别是在其AuthenticationClient和ManagementClient API中

Javascript I';我在Auth0';s节点包,特别是在其AuthenticationClient和ManagementClient API中,javascript,node.js,typescript,auth0,nestjs,Javascript,Node.js,Typescript,Auth0,Nestjs,我进入软件包,发现了确切的函数,错误显示无法识别 import { Injectable } from '@nestjs/common'; import uuid from 'uuid/v4'; import { AuthenticationClient, ManagementClient } from 'auth0'; import { EnvConfig } from '../my/env/config'; const config = { domain: EnvConfig.AUTH

我进入软件包,发现了确切的函数,错误显示无法识别

import { Injectable } from '@nestjs/common';
import uuid from 'uuid/v4';
import { AuthenticationClient, ManagementClient } from 'auth0';
import { EnvConfig } from '../my/env/config';

const config = {
  domain: EnvConfig.AUTH0_DOMAIN,
  clientId: EnvConfig.AUTH0_CLIENT_ID,
  clientSecret: EnvConfig.AUTH0_CLIENT_SECRET,
  audience: `https://${EnvConfig.AUTH0_DOMAIN}/api/v2/`,
};

@Injectable()
export class Auth0Service {
  public authenticationClient;
  public managementClient;

  constructor() {
    this.authenticationClient = AuthenticationClient(config);
    this.managementClient = ManagementClient(config);
  }
实例化AuthenticationClient和ManagementClient时发生错误。我一直在使用样板系统来设置任何第三方服务,从来没有见过一个功能无法识别。我试图重新安装软件包,但没有成功

你知道发生了什么事吗


提前谢谢。

我是个盲人,在尝试实例化的旁边没有看到“new”

(wrong)
this.authenticationClient = AuthenticationClient(config);

(correct)
this.authenticationClient = new AuthenticationClient(config);

结果证明我是瞎子,在尝试实例化的旁边没有看到“new”

(wrong)
this.authenticationClient = AuthenticationClient(config);

(correct)
this.authenticationClient = new AuthenticationClient(config);

您好,Drew,您使用的是哪个版本的node.js,您的package.json看起来怎么样?您好,Drew,您使用的是哪个版本的node.js,您的package.json看起来怎么样?