Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module "@auth0/angular-jwt/"

I'm currently developing a Web Application using ADFS authentication.

I have the following runtime error:

"Cannot find module @auth0/angular-jwt".

I'm using Angular 5.2.10. I've tried to reinstalled my dependencies, however I still have errors:

I've errors in index.d.ts:

Cannot find name 'Provider'and 'ModuleWithProviders'

And in jwt.interceptor.d.ts:

Cannot find modules "@angular/common/http" and "rxjs/internal/Observable"

And in jwtoptions.token.d.ts:

Cannot find module "@angular/core"

I haven't modified any of those files.

Is this an angular version problem? Am I using wrong versions of those libraries?

Thanks for your help!

like image 349
Hugo31 Avatar asked Sep 05 '25 16:09

Hugo31


2 Answers

  1. Delete your node_modules folder
  2. Run npm i

Try running it again

like image 106
abd995 Avatar answered Sep 09 '25 05:09

abd995


Answering for your first query i.e Cannot find module @auth0/angular-jwt"

Make sure inside node_modules folder you have specified path :- @auth0/angular-jwt/src/

If yes then use

import { JwtHelperService } from '@auth0/angular-jwt/src/jwthelper.service';

if no then first run installation with npm or yarn

npm install @auth0/angular-jwt
 
# installation with yarn 
yarn add @auth0/angular-jwt

like image 33
Joginder Malik Avatar answered Sep 09 '25 03:09

Joginder Malik