question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't import PassportStrategy from @nestjs/passport

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
israr2018commented, May 22, 2021

These steps also solved issue for me.

  1. npm uninstall -S @nestjs/passport passport
  2. npm i --save @nestjs/passport passport
1reaction
WLyKancommented, Jul 30, 2020

same error. I fixed with these steps:

  1. first, uninstall the packages: npm uninstall -S @nestjs/passport passport

  2. second, reinstall the packages npm i --save @nestjs/passport passport

done.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found