๐ฉ ํธ๋ฌ๋ธ ์ํ
NO 1
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Error:
EPERM: operation not permitted, unlink 'D:\umc-week5\node_modules\.prisma\client\query_engine-windows.dll.node'
[nodemon] app crashed - waiting for file changes before starting...
๋ฌธ์
๐
ํด๋น ์ค๋ฅ๋`query_engine-windows.dll.node`ํ์ผ์ ๋ํ ๊ถํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ฑฐ๋, ํ์ผ์ด ๋ค๋ฅธ ํ๋ก์ธ์ค์์ ์ฌ์ฉ ์ค์ธ ์ํ๋ก ์ธํด ์ญ์ ๋์ง ์์์ ๋ฐ์ํ ๊ฒ
ํด๊ฒฐ
๐
Node.js ๋ฐ ๊ด๋ จ ํ๋ก์ธ์ค๋ฅผ ์ข
๋ฃํ๊ธฐ
- ํ์ผ์ด ์ฌ์ฉ ์ค์ผ ๊ฐ๋ฅ์ฑ์ด ์์ผ๋ฏ๋ก, ๋ชจ๋ Node.js ๊ด๋ จ ํ๋ก์ธ์ค๋ฅผ ์ข
๋ฃํฉ๋๋ค:
1. Windows ์์
๊ด๋ฆฌ์๋ฅผ ์ด๊ธฐ (`Ctrl + Shift + Esc)
2. Node.js ๊ด๋ จ ํ๋ก์ธ์ค๋ฅผ ๋ชจ๋ ์ข
๋ฃ.
3. ๋ค์ npm start`** ๋ช
๋ น ์คํ.
NO 2
์ด์
๐
"resultType": "FAIL",
"error": {
"errorCode": "unknown",
"reason": "Cannot read properties of undefined (reading 'findFirst')",
"data": null
},
"success": null
}
๋ฌธ์
๐ ์ด ์ค๋ฅ ๋ฉ์์ง๋ Prisma ํด๋ผ์ด์ธํธ๋ฅผ ์ฌ์ฉํ๋ ค๋ ์ฝ๋์์ findFirst ๋ฉ์๋๋ฅผ ํธ์ถํ๋ ค ํ์ง๋ง, ํด๋น ๊ฐ์ฒด๋ ๋ฉ์๋๊ฐ ์ ์๋์ง ์์๊ธฐ ๋๋ฌธ์ ๋ฐ์ํฉ๋๋ค.
ํด๊ฒฐ
๐ Prisma Client ์ด๊ธฐํ ํ์ธ, Prisma Client ์ฌ์์ฑ
NO 3
์ด์
๐
file:///D:/umc-week5/src/auth.config.js:7
import { prisma } from "./db.config.js";
^^^^^^
SyntaxError: Identifier 'prisma' has already been declared
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:169:18)
at callTranslator (node:internal/modules/esm/loader:272:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)
Node.js v20.15.0
[nodemon] app crashed - waiting for file changes before starting...
๋ฌธ์
๐ prisma ์ค๋ณต ์ ์ธ:
- auth.config.js์์ import { prisma } from "./db.config.js";๋ก ์ํฌํธํ์ผ๋, index.js์์๋ ๊ฐ์ ๊ฐ์ฒด๋ฅผ ์ํฌํธํ์ฌ ์ค๋ณต ์ ์ธ์ด ๋ฐ์ํ ๊ฒ!
.
ํด๊ฒฐ
๐ prisma ๊ฐ์ฒด๋ฅผ ํ ๋ฒ๋ง ์ ์ํ๊ณ ํ์ํ ํ์ผ์์ ์ฌ์ฌ์ฉํ๋๋ก ์ค์
NO 4
์ด์
๐
Server is running on port 3000
set(): PrismaClientKnownRequestError:
Invalid this.prisma[this.sessionModelName].update() invocation in
D:\\umc-week5\\node_modules\\@quixo3\\prisma-session-store\\dist\\lib\\prisma-session-store.js:536:81
533 case 3:
534 _a.trys.push([3, 8, , 9]);
535 if (!(existingSession !== null)) return [3 /*break*/, 5];
→ 536 return [4 /*yield*/, this.prisma[this.sessionModelName].update(
The provided value for the column is too long for the column's type. Column: data
PrismaClientKnownRequestError:
Invalid this.prisma[this.sessionModelName].update() invocation in
D:\\umc-week5\\node_modules\\@quixo3\\prisma-session-store\\dist\\lib\\prisma-session-store.js:536:81
533 case 3:
534 _a.trys.push([3, 8, , 9]);
535 if (!(existingSession !== null)) return [3 /*break*/, 5];
→ 536 return [4 /*yield*/, this.prisma[this.sessionModelName].update(
The provided value for the column is too long for the column's type. Column: data
at Mn.handleRequestError (D:\\umc-week5\\node_modules\\@prisma\\client\\runtime\\library.js:121:7753)
at Mn.handleAndLogRequestError (D:\\umc-week5\\node_modules\\@prisma\\client\\runtime\\library.js:121:7061)
at Mn.request (D:\\umc-week5\\node_modules\\@prisma\\client\\runtime\\library.js:121:6745)
at async l (D:\\umc-week5\\node_modules\\@prisma\\client\\runtime\\library.js:130:9633)
๋ฌธ์
๐ ํด๋น ์ค๋ฅ๋ **@quixo3/prisma-session-store**์์ ์ธ์ ๋ฐ์ดํฐ๋ฅผ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฅํ๋ ค๊ณ ํ ๋, data ์ด์ ๊ฐ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ์ ์๋ ์ต๋ ๊ธธ์ด๋ฅผ ์ด๊ณผํ๊ธฐ ๋๋ฌธ์ ๋ฐ์
.
ํด๊ฒฐ
๐ data ์ด์ ๋ฐ์ดํฐ ํ์ ์์ ํ์ฌ์ ํด๊ฒฐํ์ต๋๋ค.
model Session {
id String @id
sid String @unique
data String @db.Text
expiresAt DateTime @map("expires_at")
@@map("session")
}
'{Extracurricular Activities} > UMC 7๊ธฐ - Node.js' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [UMC] 7th Ne(o)rdinary ํด์ปคํค ํ๊ณ ๋ก (1) | 2024.11.27 |
|---|---|
| [UMC 7th Server] Chapter 9. ๋ก๊ทธ์ธ ๋ฐ ํ์ ๊ฐ์ ๊ธฐ๋ฅ ๊ตฌํ (1) | 2024.11.24 |
| [UMC 7th Server] 6, 7์ฃผ์ฐจ ํธ๋ฌ๋ธ ์ํ ๊ธฐ๋ก (0) | 2024.11.19 |
| [UMC 7th Server] Chapter 8. ํ๋ก ํธ์๋ ์ฐ๋๊ณผ Swagger (2) | 2024.11.18 |
| [UMC 7th Server] Chapter 7. Express ๋ฏธ๋ค์จ์ด & API ์๋ต ํต์ผ & ์๋ฌ ํธ๋ค๋ง (3) | 2024.11.12 |