Can't import PassportStrategy from @nestjs/passport
See original GitHub issueI’m submitting a…
[x] Regression
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Install the package
npm install @nestjs/passport
Importing something from the package results in an error.
import { PassportStrategy } from '@nestjs/passport';
[nodemon] 1.18.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /usr/src/api/src/**/*
[nodemon] starting `ts-node -r tsconfig-paths/register src/main.ts`
Error: Cannot find module './dist'
Environment
"@nestjs/passport": "^1.1.0",
- Node version: v10.8.0
- Platform: Linux
Specifying ~1.0.11
resolves the issue. Looks like a re-occurrence of #2
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Authentication | NestJS - A progressive Node.js framework
With @nestjs/passport , you configure a Passport strategy by extending the PassportStrategy class. You pass the strategy options (item 1 above) by calling...
Read more >NestJS custom PassportStrategy not registered when shared ...
NestJS custom PassportStrategy not registered when shared through library ; '@nestjs/common' · import { PassportModule } · from ; '@nestjs/passport' ...
Read more >@nestjs/passport - npm
Start using @nestjs/passport in your project by running `npm i @nestjs/passport`. There are 670 other projects in the npm registry using ...
Read more >Creating social logins in NestJS - LogRocket Blog
Integrate GitHub social login into a NestJS application using the Passport library, which can be applied to other social media platforms.
Read more >error unknown authentication strategy jwt nestjs - You.com
import { ExtractJwt, Strategy } from 'passport-jwt'; import { PassportStrategy } from '@nestjs/passport'; import { Inject, Injectable } from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
These steps also solved issue for me.
same error. I fixed with these steps:
first, uninstall the packages:
npm uninstall -S @nestjs/passport passport
second, reinstall the packages
npm i --save @nestjs/passport passport
done.