49,500원
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
npm install java 설치 오류 문의
안녕하세요.node.js에서 java의 jar파일을 불러서 실행시키고 싶어서 java 모듈을 설치했습니다. (npm install java)그런데 아래 처럼 설치 오류가 나와서 어떻게 해야할지 모르겠습니다. 방법이 있다면 알려주시면 좋겠습니다.npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs npm ERR! code 1 npm ERR! path C:\workspace\test\node_modules\java npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.3.1 npm ERR! gyp info using node@18.16.0 | win32 | x64 npm ERR! gyp info find Python using Python version 3.11.3 found at "C:\Python311\python.exe" npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt npm ERR! gyp ERR! find VS checking VS2019 (16.11.33529.622) found at: npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features" npm ERR! gyp ERR! find VS - found VC++ toolset: v142 npm ERR! gyp ERR! find VS - missing any Windows SDK npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use npm ERR! gyp ERR! find VS looking for Visual Studio 2015 npm ERR! gyp ERR! find VS - not found npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload. npm ERR! gyp ERR! find VS For more information consult the documentation at: npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\workspace\test\node_modules\node-gyp\lib\find-visualstudio.js:122:47) npm ERR! gyp ERR! stack at C:\workspace\test\node_modules\node-gyp\lib\find-visualstudio.js:75:16 npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\workspace\test\node_modules\node-gyp\lib\find-visualstudio.js:369:14) npm ERR! gyp ERR! stack at C:\workspace\test\node_modules\node-gyp\lib\find-visualstudio.js:71:14 npm ERR! gyp ERR! stack at C:\workspace\test\node_modules\node-gyp\lib\find-visualstudio.js:390:16 npm ERR! gyp ERR! stack at C:\workspace\test\node_modules\node-gyp\lib\util.js:54:7 npm ERR! gyp ERR! stack at C:\workspace\test\node_modules\node-gyp\lib\util.js:33:16 npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:427:5) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1091:16) npm ERR! gyp ERR! System Windows_NT 10.0.19045 npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\workspace\\test\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd C:\workspace\test\node_modules\java npm ERR! gyp ERR! node -v v18.16.0 npm ERR! gyp ERR! node-gyp -v v9.3.1 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\yeeun\AppData\Local\npm-cache\_logs\2023-06-07T07_26_56_717Z-debug-0.log 오류를 해결하고자 참조한 링크입니다.https://yuhe-dogspaw.tistory.com/19https://velog.io/@wjs4199/React-npm-install%EC%8B%9C-node-gyp-%EC%97%90%EB%9F%AChttps://www.npmjs.com/package/node-gyp 다음과 같은 시도를 해보았지만 모두 실패 했습니다.해결 시도 1.python 2.x로 다운그레이드visual studio 2019 설치관리자모드 명령프롬프트에서 다음 2개 설치npm install --global node-gypnpm install --global --production windows-build-tools실패 ㅜㅜ해결 시도2.npm install -g node-gypnode-gyp rebuild --python "파이썬 2.x 설치 경로"npm config set python "파이썬 2.x 설치 경로"실패 ㅜㅜ 그리고, 혹시 jar 파일 말고 class 파일을 실행시키는 방법도 있을까요?const java = require('java'); java.classpath.push('jar/test.jar'); const something = java.import('com.house.test.Test'); const instance = new something(); const message = '테스트트트'; instance.fnSync(message);이렇게 사용을 하고 있는데 class 파일로도 실행할 수 있으면 좋겠습니다. 개발pc : window 10 homenode.js 버전 : 18.16 (msi로 설치할 때 강의 초반에 말씀하신 체크박스를 체크하고 설치함)python 버전 : 3.11참고로 window 11 home 혹은 window 10 pro 에서는 설치가 잘 되었습니다.
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
nextTick과 promise 우선순위에 대한 "type": "module"의 영향
package.json에서 "type": "module" 설정 유무에 따라 우선 순위가 다르게 나오는 이유가 궁금합니다.setImmediate(() => { console.log("immediate"); }); process.nextTick(() => { console.log("nextTick"); }); setTimeout(() => { console.log("timeout"); }, 0); Promise.resolve().then(() => console.log("promise"));위의 코드로 설정없이 실행 시 강의 처럼 동일한 결과가 출력되는데설정을 추가 하면 아래처럼 promise가 더 먼저 출력됩니다.이러한 결과에 대한 원인이 궁금합니다!!
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
config.json 파일을 불러올 수 없습니다.
안녕하세요 선생님npm start 실행하면 config파일이 잘 불러와지는데npm run test를 실행하면 config 파일이 불러와지지 않는 것 같습니다. routes/auth.test.js ● Test suite failed to run TypeError: Cannot read properties of undefined (reading 'database') 10 | const db = {}; 11 | const sequelize = new Sequelize( > 12 | config.database, config.username, config.password, config, | ^ 13 | ); 14 | 15 | db.sequelize = sequelize; at Object.database (models/index.js:12:12) at Object.require (app.js:17:21) at Object.<anonymous> (routes/auth.test.js:1:30) npm run test를 했을 때 뜨는 오류입니다.{ "development": { "username": "root", "password": "비밀번호", "database": "nodebird", "host": "127.0.0.1", "dialect": "mysql" },config/config.json 파일에 developmont도 존재합니다.const Sequelize = require('sequelize'); const fs = require('fs'); const path = require('path'); const env = process.env.NODE_ENV || 'development'; console.log(env); const config = require('../config/config')[env]; console.log(config) const db = {}; const sequelize = new Sequelize( config.database, config.username, config.password, config, );models/index.js 파일입니다.npm start를 실행하면 에러없이 실행되고, console.log도 실행되어서 env, config 다 undefined가 아님을 확인했습니다.어떤 부분이 문제인지 감을 잘 잡지 못하겠습니다.힌트 좀 주실 수 있을까요?
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
Error: Unable to call `followerIdList["includes"]`, which is undefined or falsey
로그인 후 포스팅 하나 작성하면 계속 에러가 발생합니다.exports.renderMain = async (req, res, next) => { try { const posts = await Post.findAll({ include: { model: User, attributes: ['id', 'nick'], }, order: [['createdAt', 'DESC']] // 최신순 정렬(작성일 기준 내림차순) }); res.render('main', { title: 'NodeBird', twits: posts }); } catch (error) { console.error(error); next(error); } };renderMain 메서드에서 따로 follwerIdList를 보내지 않는 것 같은데 {% for twit in twits %} <div class="twit"> <input type="hidden" value="{{twit.User.id}}" class="twit-user-id"> <input type="hidden" value="{{twit.id}}" class="twit-id"> <div class="twit-author">{{twit.User.nick}}</div> {% if not followerIdList.includes(twit.User.id) and twit.User.id !== user.id %} <button class="twit-follow">팔로우하기</button> {% endif %} <div class="twit-content">{{twit.content}}</div> {% if twit.img %} <div class="twit-img"><img src="{{twit.img}}" alt="섬네일"></div> {% endif %} </div> {% endfor %}followerIdList는 어디서 나온 어디서 나온건지 찾을 수가 없습니다..
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
Unkown column 'Post.UserId' in 'field list'
rendermain Executing (default): SELECT `Post`.`id`, `Post`.`content`, `Post`.`img`, `Post`.`createdAt`, `Post`.`updatedAt`, `Post`.`UserId`, `User`.`id` AS `User.id`, `User`.`nick` AS `User.nick` FROM `posts` AS `Post` LEFT OUTER JOIN `users` AS `User` ON `Post`.`UserId` = `User`.`id` AND (`User`.`deletedAt` IS NULL) ORDER BY `Post`.`createdAt` DESC; Error at Query.run (C:\Users\user\study\nodejs\nodebird\node_modules\sequelize\lib\dialects\mysql\query.js:52:25) at C:\Users\user\study\nodejs\nodebird\node_modules\sequelize\lib\sequelize.js:315:28 at processTicksAndRejections (internal/process/task_queues.js:95:5) at async MySQLQueryInterface.select (C:\Users\user\study\nodejs\nodebird\node_modules\sequelize\lib\dialects\abstract\query-interface.js:407:12) at async Function.findAll (C:\Users\user\study\nodejs\nodebird\node_modules\sequelize\lib\model.js:1140:21) at async exports.renderMain (C:\Users\user\study\nodejs\nodebird\controllers\page.js:16:23) { name: 'SequelizeDatabaseError', parent: Error: Unknown column 'Post.UserId' in 'field list' at Packet.asError (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\packets\packet.js:728:17) at Query.execute (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\commands\command.js:29:26) at Connection.handlePacket (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\connection.js:489:32) at PacketParser.onPacket (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\connection.js:94:12) at PacketParser.executeStart (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\packet_parser.js:75:16) at Socket.<anonymous> (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\connection.js:101:25) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:293:12) at readableAddChunk (internal/streams/readable.js:267:9) at Socket.Readable.push (internal/streams/readable.js:206:10) { code: 'ER_BAD_FIELD_ERROR', errno: 1054, sqlState: '42S22', sqlMessage: "Unknown column 'Post.UserId' in 'field list'", sql: 'SELECT `Post`.`id`, `Post`.`content`, `Post`.`img`, `Post`.`createdAt`, `Post`.`updatedAt`, `Post`.`UserId`, `User`.`id` AS `User.id`, `User`.`nick` AS `User.nick` FROM `posts` AS `Post` LEFT OUTER JOIN `users` AS `User` ON `Post`.`UserId` = `User`.`id` AND (`User`.`deletedAt` IS NULL) ORDER BY `Post`.`createdAt` DESC;', parameters: undefined }, original: Error: Unknown column 'Post.UserId' in 'field list' at Packet.asError (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\packets\packet.js:728:17) at Query.execute (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\commands\command.js:29:26) at Connection.handlePacket (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\connection.js:489:32) at PacketParser.onPacket (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\connection.js:94:12) at PacketParser.executeStart (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\packet_parser.js:75:16) at Socket.<anonymous> (C:\Users\user\study\nodejs\nodebird\node_modules\mysql2\lib\connection.js:101:25) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:293:12) at readableAddChunk (internal/streams/readable.js:267:9) at Socket.Readable.push (internal/streams/readable.js:206:10) { code: 'ER_BAD_FIELD_ERROR', errno: 1054, sqlState: '42S22', sqlMessage: "Unknown column 'Post.UserId' in 'field list'", sql: 'SELECT `Post`.`id`, `Post`.`content`, `Post`.`img`, `Post`.`createdAt`, `Post`.`updatedAt`, `Post`.`UserId`, `User`.`id` AS `User.id`, `User`.`nick` AS `User.nick` FROM `posts` AS `Post` LEFT OUTER JOIN `users` AS `User` ON `Post`.`UserId` = `User`.`id` AND (`User`.`deletedAt` IS NULL) ORDER BY `Post`.`createdAt` DESC;', parameters: undefined }, sql: 'SELECT `Post`.`id`, `Post`.`content`, `Post`.`img`, `Post`.`createdAt`, `Post`.`updatedAt`, `Post`.`UserId`, `User`.`id` AS `User.id`, `User`.`nick` AS `User.nick` FROM `posts` AS `Post` LEFT OUTER JOIN `users` AS `User` ON `Post`.`UserId` = `User`.`id` AND (`User`.`deletedAt` IS NULL) ORDER BY `Post`.`createdAt` DESC;', parameters: {} } GET / 500 25.038 ms - 2481 GET /main.css 200 2.256 ms - 2609 exports.renderMain = async (req, res, next) => { console.log('rendermain') try { const posts = await Post.findAll({ include: { model: User, attributes: ['id', 'nick'], }, order: [['createdAt', 'DESC']] // 최신순 정렬(작성일 기준 내림차순) }); console.log(posts); res.render('main', { title: 'NodeBird', twits: posts }); } catch (error) { console.error(error); next(error); } };안녕하세요 선생님npm run start 서버 띄우고 localhost:8001 로 갔을 때 나오는 에러 입니다.사진도 같이 띄웁니다.controller/page.js 에서 16번째 줄에서 에러가 발생하길래 확인하였는데위 에러 코드에서 보이듯이 sql문에 Post테이블의 UserId 컬럼이 포함되어 있었습니다.Post 테이블 만들 때 UserId 컬럼을 명시한 적이 없는데 왜 sql 문에 포함되었는지 잘 이해가 안 갑니다ㅠㅠ
- 해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
windows에서 nodemon을 통한 app.js 실행 문제
안녕하세요 선생님windows 11 운영체제 플랫폼에서 강의를 수강하고 있습니다.webstorm IDE 사용하고 있습니다.nvm windows를 설치해서 사용 중이며 node 18 lts 버전을 사용 중에 있습니다.npm i nodemon --save-devpackage.json에 devDependencies에 추가한 상태입니다.선생님과 똑같이 cmd 창에서 node app 입력했을 경우 잘 실행이 되었는데요.nodemon app 을 입력했을 경우 다음과 같이 실행할 수 없습니다.C:\Users\mingyo\study\nodejs\nodePractice\express>nodemon app'nodemon'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다.C:\Users\mingyo\study\nodejs\nodePractice\express>nodemon app.js'nodemon'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다.찾아봤을 때는nodemon을 -g 옵션을 줘서 전역으로 설치하는 방법시스템 환경 변수를 수정(?)하는 방법이렇게 크게 두 가지 방법이 있는 것 같았습니다.global 설치는 선생님이 별로 추천하지 않는다고 하셔서 어떤 해결 방법을 사용하는 걸 추천하시는지 궁금합니다.아 그리고 nvm windows를 사용해서 node를 다운받았는데, nvm windows 사용으로 인해 이 문제가 발생한 건지도 궁금합니다.조금 찾아보긴 했는데 이렇게 질문드리는 게 적절한지 잘 모르겠습니다.
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
마지막 수업 중 TypeScript로 전환하는 과정에서 LocalStrategy를 수정하던 중 발생한 오류입니다.
안녕하세요.수업 너무 잘 듣고 있던 학생입니다. 다름이 아닌 수업에서는 수정하지 않았지만 다음과 같은 오류가 발생하였고, 오류내용은 다음과 같습니다.-> 해당 코드는 controllers > auth.ts파일 중 login메서드의 구현부입니다.$ npx tsc --noEmit controller/auth.ts:27:37 - error TS7006: Parameter 'authError' implicitly has an 'any' type. 27 passport.authenticate('local', (authError, user, info) => { ~~~~~~~~~ controller/auth.ts:27:48 - error TS7006: Parameter 'user' implicitly has an 'any' type. 27 passport.authenticate('local', (authError, user, info) => { ~~~~ controller/auth.ts:27:54 - error TS7006: Parameter 'info' implicitly has an 'any' type. 27 passport.authenticate('local', (authError, user, info) => { ~~~~ Found 3 errors in the same file, starting at: controller/auth.ts:27그래서 해당 파라미터를 any로 타입을 줘서 해결하였지만, any를 가급적 사용하고 싶지 않아 다른 방법을 찾고 있는데 괜찮은 방법이 있을까요? 시도했던 방법은 다음과 같습니다.콜백함수를 별도의 함수로 빼내어 타입을 지정해준 방법 (passport모듈의 AuthenticateCallback타입)-> 하지만 message에서 다음과 같은 오류를 받음.controller/auth.ts:33:55 - error TS2339: Property 'message' does not exist on type 'string | object | (string | undefined)[]'. Property 'message' does not exist on type 'string'. 33 return res.redirect(`/?loginError=${info?.message}`);-> message as string으로 해결해보려 하였지만 같은 오류메세지를 반복.
- 해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
몽고디비 몽구스와 socket.io를 활용한 실시간 채팅 페이지
안녕하세요.현재 프로젝트 시작했는데 백엔드 배정받아 급하게 강의 결제후 듣고 있습니다.인스타그램 같은 어플을 만들 예정인데, 저는 채팅쪽 파트를 맡게 되었습니다.리액트, node.js mongodb, mongoose를 사용하기로 했으며 제가 구현해야 하는 기능은 이렇습니다.아이디를 검색했을 때 나오는 유저와 채팅하기 버튼을 누르면, 그 유저와 1대1 채팅이 가능하도록 해야합니다. 그리고 채팅 후 방을 둘 다 나가기 하지 않는 이상 채팅방은 계속 유지되어 계속 채팅을 이어나갈 수 있어야 합니다.스키마작성부터 CRUD 코드 작성, 서비스코드 작성, 라우터 코드 작성까지,, 손도 못대겠네요 ㅎㅎ아무리 머리를 쥐어 짜내봐도, 어떻게 구현해야할지 감조차 안잡혀서 유튜브 검색해보면 외국인 강좌들 밖에 안나와서,, 어떻게 해야할까요ㅎㅎfigma는 위와 같습니다.프론트만 해보다 보니 뭘 어떻게 해야할지 모르겠어요,,,ㅠㅠ
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
백그라운드 실행과 스레드 질문
안녕하세요비동기 함수들은 백그라운드로 보내서 실행이 된다고 하셨는데그럼 백그라운드에서 실행되는 애들이 멀티스레드로 실행이 되는건가요?setTimeout, promise를 호출하면 둘 다 백그라운드로 이동하는데여기서 백그라운드 영역은 여러 스레드가 백그라운드로 온 함수들을 동시에 실행하고 태스크 큐로 보내고 이벤트 루프가 호출 스택이 비었을 때 태스크 큐에 작업이 남아있다면 호출스택으로 올려서 작업을 실행하는 것이 맞을까요?감사합니다!
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
에러처리
에러처리 해줄때 app.js에 에러처리 미들웨어를 해주시는데 꼭 이 방식으로 에러 처리를 해줘야하나요? 아니면 보통 router를타고 특정 함수에서 res.status(405).json(dfsa);이렇게 하나하나 처리해주면 안되나요?
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
(req,res,next) -> next()
책에서 프로젝트를 진행하다보면 보통try { }catch(error) {console.error(error);next(error)}로 next(error)를 해주시는데 error가 발생했을때 console.error(error)를 찍고 next(error)에서 에러처리(ex)프로젝트에서 app.use((err, req, res, next) => { res.locals.message = err.message; res.locals.error = process.env.NODE_ENV !== 'production' ? err : {}; res.status(err.status || 500); res.render('error'); });여기로로 보내지는게 맞나요?
- 해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
제로초 슬랙방에 참여가 불가능합니다.
위와 같이 활성 상태가 아니라고만 뜹니다. http://bitly.ws/yCFL이 링크를 통해 들어가려고 시도했습니다.2번째 동영상 강의교안, 깃헙 등 링크모음 강의에 있는 링크 입니다.
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
mongo에러?
https://www.inflearn.com/questions/612530/m1%EB%A7%A5%EB%B6%81-%EB%AA%BD%EA%B3%A0%EB%94%94%EB%B9%84-%EC%84%A4%EC%B9%98%EB%AC%B8%EC%A0%9C위 글에서 작성자가질문했던것처럼 같은 에러가 나고 해결이 안되고 있습니다.. ㅠㅡㅠ 해결 방법을 아무리 찾아봐도 알수가 없어서 질문 남깁니다!.! 몽고db전체를 삭제하고 다시 설치도 해보았고 권한문제등 여러가지 해결해보려고 했는데 안되서 문의남깁니다. ![제로초 강좌 질문 필독 사항입니다]질문에는 여러분에게 도움이 되는 질문과 도움이 되지 않는 질문이 있습니다.도움이 되는 질문을 하는 방법을 알려드립니다.https://www.youtube.com/watch?v=PUKOWrOuC0c0. 숫자 0부터 시작한 이유는 1보다 더 중요한 것이기 때문입니다. 에러가 났을 때 해결을 하는 게 중요한 게 아닙니다. 왜 여러분은 해결을 못 하고 저는 해결을 하는지, 어디서 힌트를 얻은 것이고 어떻게 해결한 건지 그걸 알아가셔야 합니다. 그렇지 못한 질문은 무의미한 질문입니다.1. 에러 메시지를 올리기 전에 반드시 스스로 번역을 해야 합니다. 번역기 요즘 잘 되어 있습니다. 에러 메시지가 에러 해결 단서의 90%를 차지합니다. 한글로 번역만 해도 대부분 풀립니다. 그냥 에러메시지를 올리고(심지어 안 올리는 분도 있습니다. 저는 독심술사가 아닙니다) 해결해달라고 하시면 아무런 도움이 안 됩니다.2. 에러 메시지를 잘라서 올리지 않아야 합니다. 입문자일수록 에러메시지에서 어떤 부분이 가장 중요한 부분인지 모르실 겁니다. 그러니 통째로 올리셔야 합니다.3. 코드도 같이 올려주세요. 다만 코드 전체를 다 올리거나, 깃헙 주소만 띡 던지지는 마세요. 여러분이 "가장" 의심스럽다고 생각하는 코드를 올려주세요.4. 이 강좌를 바탕으로 여러분이 응용을 해보다가 막히는 부분, 여러 개의 선택지 중에서 조언이 필요한 부분, 제 경험이 궁금한 부분에 대한 질문은 대환영입니다. 다만 여러분의 회사 일은 질문하지 마세요.5. 강좌 하나 끝날 때마다 남의 질문들을 읽어보세요. 여러분이 곧 만나게 될 에러들입니다.6. 위에 적은 내용을 명심하지 않으시면 백날 강좌를 봐도(제 강좌가 아니더라도) 실력이 늘지 않고 그냥 코딩쇼 관람 및 한컴타자연습을 한 셈이 될 겁니다.
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
async
강의를 진행하다보니 어쩔땐 async를 사용하고 사용하지 않을때가 있으신데 이건 어떻게 구분을 하며 사용을 해야하나요?
- 해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
9장 프로젝트 구조갖추기부분
컨트롤러스 page.js 에서 이부분 객체로 만든건가요?exports.renderProfile=(req,res,next)=>{}
- 미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
회원가입 로직시 controller\auth 랑 localStrategy
controller\auth 랑 passport\localStrategy에서 로그인 post를 보낼때의 경우가 service로 보내서 비즈니스로직을 돌고 컨트롤러에 return값을 보내주는 방식으로 passport\localStrategy가 Service역할을 한다고 생각해도 괜찮나요?
- 해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
분리한 라우터를 한번 더 분리하고 싶으면 어떻게 해야 하나요?
예를들어 api 들은/api로 요청을 받아서 api들만 따로 빼주었는데여기서 한번더 /api/user/api/board이런식으로 분리하고싶다면 어떤 방법이 가장 좋을까요..?
- 해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
8.6.1 다시질문!
mongoose.connect 콜백함수 수정했고 다만들고 실행했는데Operation users.find() buffering timed out after 10000msMongoServerSelectionError: connect ECONNREFUSED ::1:27017mongod연결했는데 이렇게 에러 뜨네요 ㅜㅠ schemas/index.js에서 콜백함수 수정한 코드입니다 혹시 제가 잘못수정한건가요? const mongoose = require("mongoose"); const connect = () => { if (process.env.NODE_ENV !== "production") { mongoose.set("debug", true); } mongoose .connect("mongodb://root:nodejsbook@localhost:27017/admin", { dbName: "nodejs", useNewUrlParser: true, }) .then(() => { console.log("몽고디비 연결 성공"); }) .catch(() => { console.log("몽고디비 연결 에러"); }); }; mongoose.connection.on("error", (error) => { console.error("몽고디비 연결 에러", error); }); mongoose.connection.on("disconnected", () => { console.error("몽고디비 연결이 끊겼습니다. 연결을 재시도합니다."); connect(); }); module.exports = connect;
- 해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
8.6.1절에 connect
connect에 콜백 이제 안된다고해서 코드를 promise로 썻는데 잘작성이안되네요 어떻게 쓰면될까요? ㅠㅠ
- 해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
req 에서 user 데이터를 못 받아와서 api 서버 로그인 후 화면이 안뜹니다ㅠ
[제로초 강좌 질문 필독 사항입니다]질문에는 여러분에게 도움이 되는 질문과 도움이 되지 않는 질문이 있습니다.도움이 되는 질문을 하는 방법을 알려드립니다.https://www.youtube.com/watch?v=PUKOWrOuC0c<로그인 누른 후의 화면> <localStrategy.js> 안녕하세요 제로초님 강의 잘 듣던 중 로그인이 안되서이렇게 순차적으로 콘솔을 찍어보면서 경로를 확인해보고 있었는데 /auth/login Post 요청까지는 성공적으로 되서 컨트롤러/index.js 의 renderLogin 함수를 보면 req.user가 안 떠서 문의 드립니다. 갑자기 데이터가 사라질 리는 없기에 같은 강의를 계속 돌려보면서 제로초님과 저의 코드 차이를 봤는데 없어서 이유를 몰라 문의드립니다ㅠ