我有以下出口:
import * as jwt from 'jsonwebtoken';
...
export type JsonWebToken = typeof jwt;
然后,我尝试像这样使用它:
export class AuthService {
constructor(
@Inject(constants.JWT) private readonly jsonWebToken: JsonWebToken,
// error here ^
){}
我收到此错误,指向JsonWebToken
:
ReferenceError: jwt_provider_1 is not defined
at Object.<anonymous> (D:\Learning\nest\project\server\modules\Auth\auth.service.ts:9:59)
at Module._compile (module.js:573:30)
at Module.m._compile (D:\Learning\nest\project\node_modules\ts-node\src\index.ts:392:23)
at Module._extensions..js (module.js:584:10)
at Object.require.extensions.(anonymous function) [as .ts] (D:\Learning\nest\project\node_modules\ts-node\src\index.ts:395:12)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)