Giter Site home page Giter Site logo

dev.to's People

Contributors

ehren12 avatar jmcdo29 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dev.to's Issues

nestjs-passport-sessions blog no longer works

I was trying to follow along with your blog (and comments) but got stuck trying to initialize passport. I eventually decided to clone this repo and try your version to see what was different.

First, npm did not want to install due to conflicting dependencies

dev.to$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: dev.to@undefined
npm ERR! Found: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! dev @nestjs/common@"^8.0.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"^7.x" from @golevelup/[email protected]
npm ERR! node_modules/@golevelup/nestjs-modules
npm ERR! dev @golevelup/nestjs-modules@"^0.4.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
the full error report is below

npm resolution error report

2022-03-30T16:47:32.656Z

While resolving: dev.to@undefined
Found: @nestjs/[email protected]
node_modules/@nestjs/common
dev @nestjs/common@"^8.0.6" from the root project

Could not resolve dependency:
peer @nestjs/common@"^7.x" from @golevelup/[email protected]
node_modules/@golevelup/nestjs-modules
dev @golevelup/nestjs-modules@"^0.4.2" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Raw JSON explanation object:

{
"code": "ERESOLVE",
"current": {
"name": "@nestjs/common",
"version": "8.4.3",
"whileInstalling": {
"name": "dev.to",
"path": "/home/.../dev.to"
},
"location": "node_modules/@nestjs/common",
"isWorkspace": false,
"dependents": [
{
"type": "dev",
"name": "@nestjs/common",
"spec": "^8.0.6",
"from": {
"location": "/home/.../dev.to"
}
}
]
},
"currentEdge": {
"type": "dev",
"name": "@nestjs/common",
"spec": "^8.0.6",
"from": {
"location": "/home/.../dev.to"
}
},
"edge": {
"type": "peer",
"name": "@nestjs/common",
"spec": "^7.x",
"error": "INVALID",
"from": {
"name": "@golevelup/nestjs-modules",
"version": "0.4.4",
"whileInstalling": {
"name": "dev.to",
"path": "/home/.../dev.to"
},
"location": "node_modules/@golevelup/nestjs-modules",
"isWorkspace": false,
"dependents": [
{
"type": "dev",
"name": "@golevelup/nestjs-modules",
"spec": "^0.4.2",
"from": {
"location": "/home/.../dev.to"
}
}
]
}
},
"strictPeerDeps": false,
"force": false
}
So, I used npm install --force to get past that

When I tried to launch the app, I got a very similar error to the one which was blocking my own implementation

dev.to/blog-posts/nestjs-passport-sessions$ npx nest start
[Nest] 267343 - 03/30/2022, 9:39:02 AM LOG [NestFactory] Starting Nest application...
[Nest] 267343 - 03/30/2022, 9:39:03 AM LOG [InstanceLoader] PassportModule dependencies initialized +838ms
[Nest] 267343 - 03/30/2022, 9:39:03 AM LOG [InstanceLoader] RedisModule dependencies initialized +0ms
[Nest] 267343 - 03/30/2022, 9:39:03 AM LOG [InstanceLoader] AppModule dependencies initialized +2ms
[Nest] 267343 - 03/30/2022, 9:39:03 AM LOG [InstanceLoader] AuthModule dependencies initialized +0ms

/home/.../dev.to/node_modules/passport/lib/authenticator.js:133
return this._framework.initialize(this, options);
^
TypeError: Cannot read properties of undefined (reading 'initialize')
at Authenticator.initialize (/home/.../dev.to/node_modules/passport/lib/authenticator.js:133:26)
at AppModule.configure (/home/.../dev.to/blog-posts/nestjs-passport-sessions/dist/app.module.js:41:39)
at MiddlewareModule.loadConfiguration (/home/.../dev.to/node_modules/@nestjs/core/middleware/middleware-module.js:49:24)
at loadMiddlewareConfiguration (/home/.../dev.to/node_modules/@nestjs/core/middleware/middleware-module.js:38:24)
at Array.map ()
at MiddlewareModule.resolveMiddleware (/home/.../dev.to/node_modules/@nestjs/core/middleware/middleware-module.js:41:41)
at MiddlewareModule.register (/home/.../dev.to/node_modules/@nestjs/core/middleware/middleware-module.js:33:20)
at NestApplication.registerModules (/home/.../dev.to/node_modules/@nestjs/core/nest-application.js:80:37)
at NestApplication.init (/home/.../dev.to/node_modules/@nestjs/core/nest-application.js:94:20)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Environment:

Node.js Version: 16.13.2
Node Redis Version: 3.1.2
Platform: Ubuntu 20.04.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.