jmcdo29 / dev.to Goto Github PK
View Code? Open in Web Editor NEWA repo for holding my dev.to posts, to allow me to keep them n source control and easily deploy them
A repo for holding my dev.to posts, to allow me to keep them n source control and easily deploy them
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.