묻고 답해요
156만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
몽고쉘 다운
몽고쉘 다운로드는 윈도우 유저만 해당인가요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
nodejs mysql 도커 컴포즈관련해서 문의 드립니다
docker-compose.yml파일의 코드는이렇게 구성하였는데요도커컴포즈하면 mysql데이터 가져오고싶은데 어떻게 해야하나요? volume으로 해봤는데 해당 데이터들은 못가져오고 새로 table을 생성되는데이렇게 구성되어있습니다 main스키마의 table들을 가져오고싶습니다.이렇게해봤는데도 원하는대로 데이터를 가져오지못했습니다mysql연결도 안되는 상황입니다 어떻게 해야 해결할수있을까요?
-
해결됨Slack 클론 코딩[백엔드 with NestJS + TypeORM]
궁금한 사항
강의보던중 front 도 시작하시는걸봤는데 프론트없어도 클론코딩할 수 있는건가요??
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
docker-compose의 image 옵션 사용시 docker가 1개만 만들어집니다.
docker-compose.yaml에서 강의대로 소스를 수정했습니다.그 후 yarn add mongoose를 하고index.js를 수정한 후그리고 docker-compose build를 했는데요. my-backend는 만들어졌는데 my-database가 만들어지지 않습니다. my-database 부분은 아예 실행조차 하지 않은것처럼 보이는데요. 구글에서도 잘 찾아지지 않아 질문 드립니다.
-
해결됨Slack 클론 코딩[백엔드 with NestJS + TypeORM]
제네레이트 마이그레이션 오류
yujinseung@yujinseung-ui-MacBookPro slack_nest % npm run db:generate-migration > study_nest@0.0.1 db:generate-migration > npm run typeorm migration:generate -- ./src/migrations -d ./dataSource.ts > study_nest@0.0.1 typeorm > typeorm migration:generate ./src/migrations -d ./dataSource.ts Error during migration generation: Error: Unable to open file: "/Users/yujinseung/Desktop/slack_nest/dataSource.ts". Cannot use import statement outside a module at CommandUtils.loadDataSource (/Users/yujinseung/Desktop/slack_nest/node_modules/typeorm/commands/CommandUtils.js:22:19) at async Object.handler (/Users/yujinseung/Desktop/slack_nest/node_modules/typeorm/commands/MigrationGenerateCommand.js:68:26)yujinseung@yujinseung-ui-MacBookPro slack_nest % npm run db:migrate > study_nest@0.0.1 db:migrate > npm run typeorm migration:run -- -d ./dataSource.ts > study_nest@0.0.1 typeorm > typeorm migration:run -d ./dataSource.ts Error during migration run: Error: Unable to open file: "/Users/yujinseung/Desktop/slack_nest/dataSource.ts". Cannot use import statement outside a module at CommandUtils.loadDataSource (/Users/yujinseung/Desktop/slack_nest/node_modules/typeorm/commands/CommandUtils.js:22:19) at async Object.handler (/Users/yujinseung/Desktop/slack_nest/node_modules/typeorm/commands/MigrationRunCommand.js:41:26)위 두 오류가 뜹니다..! 뭐가문제일까요..ㅠㅠ
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
로그아웃이 작동하지 않아서 질문드립니다.
안녕하세요 제로초님 로그인은 되는데 로그아웃이 되지않아서 질문남깁니다.로그인 한 다음 로그아웃을 하면 위와 같이 AxiosError가 나서 네트워크와 리덕스를 확인해보니깐 로그아웃 요청시 302 Found가 뜨고 404 Not Found라는 에러 메세지가 뜹니다.그리고 리덕스에서는 실패 메세지가 뜹니다. // UserProfile import { logoutRequestAction } from '../reducers/user'; const dispatch = useDispatch(); const { me, logOutLoading } = useSelector((state) => state.user); const onLogOut = useCallback(() => { dispatch(logoutRequestAction()); }, []); <Button onClick={onLogOut} loading={logOutLoading}> 로그아웃 </Button> // 리덕스 logOutLoading: false, // 로그아웃 시도중 logOutDone: false, logOutError: null, export const LOG_OUT_REQUEST = 'LOG_OUT_REQUEST'; export const LOG_OUT_SUCCESS = 'LOG_OUT_SUCCESS'; export const LOG_OUT_FAILURE = 'LOG_OUT_FAILURE'; case LOG_OUT_REQUEST: draft.logOutLoading = true; draft.logOutDone = false; draft.logOutError = null; break; case LOG_OUT_SUCCESS: draft.logOutLoading = false; draft.logOutDone = true; draft.me = null; break; case LOG_OUT_FAILURE: draft.logOutLoading = false; draft.logOutError = action.error; break; 사가 axios.defaults.baseURL = 'http://localhost:3065'; function logOutAPI() { return axios.post('/user/logout'); } function* logOut() { try { yield call(logOutAPI); yield put({ type: LOG_OUT_SUCCESS, }); } catch (err) { console.log(err); yield put({ type: LOG_OUT_FAILURE, error: err.response.data, }); } } function* watchLogOut() { yield takeEvery(LOG_OUT_REQUEST, logOut); } app.js const express = require('express'); const cors = require('cors'); // session, cookieParser, dotenv const session = require('express-session'); const cookieParser = require('cookie-parser'); const dotenv = require('dotenv'); // passport 로그인 설정 const passport = require('passport'); const passportConfig = require('./passport'); passportConfig(); const postRouter = require('./routes/post'); const userRouter = require('./routes/user'); dotenv.config(); const app = express(); // 시퀄라이즈 - db 연결 const db = require('./models/index.js'); db.sequelize .sync() .then(() => { console.log('db 연결 성공'); }) .catch(console.error); app.use( cors({ origin: true, credentials: true, }) ); app.use(express.json()); app.use(express.urlencoded({ extended: true })); // session,cookieParser app.use(cookieParser(process.env.COOKIE_SECRET)); app.use( session({ saveUninitialized: false, resave: false, secret: process.env.COOKIE_SECRET, }) ); app.use(passport.initialize()); app.use(passport.session()); app.use('/post', postRouter); app.use('/user', userRouter); app.listen(3065, () => { console.log('3065 포트에서 대기중'); }); user.js const express = require('express'); const router = express.Router(); const passport = require('passport'); const bcrypt = require('bcrypt'); const { User, Post } = require('../models'); // 로그인 POST/user/login router.post('/login', (req, res, next) => { passport.authenticate('local', (err, user, info) => { if (err) { console.error(err); return next(err); } if (info) { return res.status(403).send(info.reason); } return req.login(user, async (loginErr) => { if (loginErr) { console.error(loginErr); return next(loginErr); } const fullUserWithoutPassword = await User.findOne({ where: { id: user.id }, attributes: { exclude: ['password'], }, include: [ { model: Post, }, { model: User, as: 'Followings', }, { model: User, as: 'Followers', }, ], }); return res.status(200).json(fullUserWithoutPassword); }); })(req, res, next); }); // 로그아웃 POST/user/logout router.post('/logout', (req, res, next) => { req.logout(() => { res.redirect('/'); }); }); //회원가입 POST / user router.post('/', async (req, res, next) => { try { const exUser = await User.findOne({ where: { email: req.body.email, }, }); if (exUser) { return res.status(403).send('이미 사용중인 아이디입니다.'); } const hashedPassword = await bcrypt.hash(req.body.password, 10); await User.create({ email: req.body.email, nickname: req.body.nickname, password: hashedPassword, }); res.status(200).send('ok'); } catch (error) { console.error(error); next(error); } }); module.exports = router; 로그인과 회원가입은 제대로 작동하는데 로그아웃만 되지 않습니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
섹션 29 10-1 Entity 구현 선행 강좌
섹션 28에서는 스타벅스를 가지고 ERD 까지 그렸는데, 섹션 29에서 새로운 ERD를 가지고 Entity 구현하는 것 같네요. 강의가 업데이트가 안된걸까요?
-
해결됨하루만에 배우는 express with AWS
성능테스트 관련 내용은 언제 업데이트되나요?
섹션 0에서 말씀해주신 성능테스트 관련 강의는 언제 업데이트될까요?
-
해결됨Slack 클론 코딩[백엔드 with NestJS + TypeORM]
이 강의에 관해서 출판 된 책이나 문서 같은 건 없는 건가요?
완강후 실무에 써먹어 보려는 데 종종 다시 찾아봐야 할 때가 있을꺼 같아서요.없어도 크게 불편 할 것은 없습니다.
-
해결됨Slack 클론 코딩[백엔드 with NestJS + TypeORM]
MySQL이 연결되지않습니다
Error: connect ECONNREFUSED ::1:3306at TCPConnectWrap.afterConnect [as oncomplete] 라는 오류가 뜹니다상황설명 : create~~ 가 뜨면서 sleact DB가 만들어졌다가 3306이 이미 써져있어서 그렇다라는 글을 보고 sudo killall mysqld 를 썼다가 DB가 다 날라가고 나서 다시 MySQL을 깔고 db:create, start:dev를 하였더니 똑같이 저런 오류가 뜹니다..import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; import { ConfigModule, ConfigService } from '@nestjs/config'; import { AppController } from './app.controller'; import { AppService } from './app.service'; import { LoggerMiddleware } from './middlewares/logger.middlware'; import { UsersModule } from './users/users.module'; import { WorkspacesModule } from './workspaces/workspaces.module'; import { ChannelsModule } from './channels/channels.module'; import { DmsModule } from './dms/dms.module'; import { UsersService } from './users/users.service'; import { TypeOrmModule } from '@nestjs/typeorm'; import { Users } from './entities/Users'; import { WorkspaceMembers } from './entities/WorkspaceMembers'; import { ChannelChats } from './entities/ChannelChats'; import { ChannelMembers } from './entities/ChannelMembers'; import { Channels } from './entities/Channels'; import { DMs } from './entities/DMs'; import { Mentions } from './entities/Mentions'; import { Workspaces } from './entities/Workspaces'; @Module({ imports: [ ConfigModule.forRoot({ isGlobal: true }), UsersModule, WorkspacesModule, ChannelsModule, DmsModule, TypeOrmModule.forRoot({ type: 'mysql', host: 'localhost', port: 3306, username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, database: process.env.DB_DATABASE, entities: [ ChannelChats, ChannelMembers, Channels, DMs, Mentions, Users, WorkspaceMembers, Workspaces, ], synchronize: true, logging: true, keepConnectionAlive: true, charset: 'utf8mb4_general_ci', }), TypeOrmModule.forFeature([Users]), ], controllers: [AppController], providers: [AppService, ConfigService, UsersService], }) export class AppModule implements NestModule { configure(consumer: MiddlewareConsumer) { consumer.apply(LoggerMiddleware).forRoutes('*'); } } DB_USERNAME=root DB_PASSWORD=저의 비밀번호입력했습니다 DB_DATABASE=sleact PORT=3000
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
errno -4094 의 unknown error 가 종종 뜹니다
npm run dev로 실행시킨 후에 코드 수정 및 자동반영(핫리로드라고 하나요..?)이 잘 되다가어느 순간 이런 에러가 뜹니다. - error [Error: UNKNOWN: unknown error, open 'F:\dev\project\react\node-bird\.next\static\chunks\pages\login.js'] { digest: undefined[Error: UNKNOWN: unknown error, open 'F:\dev\project\react\node-bird\.next\static\chunks\pages\login.js'] { errno: -4094, code: 'UNKNOWN', syscall: 'open', path: 'F:\\dev\\project\\react\\node-bird\\.next\\static\\chunks\\pages\\login.js'} 터미널에서 실행중인 프로세스 종료하고 다시 npm run dev 로 실행시키면 정상동작하기는 합니다만 혹시 에러가 발생하지 않도록 하는 방법이 있을가 해서 문의 남겨봅니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
섹션13. 마이크로서비스> Error [ERR_REQUIRE_ESM]
안녕하세요.(2022년도 강의) 섹션13. Microservice - API-Gateway 2 강의에서 질문이 있습니다.Microservice의 Graphql기반의 API 서버를 구성하는 예제에서 Gateway 서버에서 아래와 같은 에러가 발생합니다. (캡쳐 참고)const wrapAnsi = require('wrap-ansi');Error [ERR_REQUIRE_ESM]: require() of ES Module /api-gateway/node_modules/wrap-ansi/index.js from /api-gateway/node_modules/@nestjs/cli/node_modules/inquirer/lib/utils/screen-manager.js not supported.Node모듈에서 import 방식이 아닌 require 를 통해 다른 모듈을 로드해서 오류라는 것 같은데요.이 경우, 어떻게 해야할까요? ㅠ
-
해결됨비전공자를 위한 진짜 입문 올인원 개발 부트캠프
커밋 메시지가 잘 이해 안됩니다
커밋 메시지가 뭔가요?git commit -m "project init" 에서"project init" 대신 다른 것을 써넣어도 작동하나요?"project init" 이 어떤 역할을 하는지 잘 모르겠습니다.
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 영화 사이트 만들기
npm run dev 오류
npm run dev 를 실행했더니[0] Error: listen EADDRINUSE: address already in use :::5000[0] at Server.setupListenHandle [as _listen2] (node:net:1751:16)[0] at listenInCluster (node:net:1799:12)[0] at Server.listen (node:net:1887:7)[0] at Function.listen (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\node_modules\express\lib\application.js:635:24)[0] at Object.<anonymous> (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\server\index.js:58:5)[0] at Module._compile (node:internal/modules/cjs/loader:1256:14)[0] at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)[0] at Module.load (node:internal/modules/cjs/loader:1119:32)[0] at Module._load (node:internal/modules/cjs/loader:960:12)[0] at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)[0] at node:internal/main/run_main_module:23:47[0] Emitted 'error' event on Server instance at:[0] at emitErrorNT (node:net:1778:8)[0] at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {[0] code: 'EADDRINUSE',[0] errno: -4091,[0] syscall: 'listen',[0] address: '::',[0] port: 5000[0] }[0][0] Node.js v18.17.1[0] [nodemon] app crashed - waiting for file changes before starting...[1] [HPM] Proxy created: / -> http://localhost:5000[1] i 「wds」: Project is running at http://192.168.123.105/[1] i 「wds」: webpack output is served from[1] i 「wds」: Content not from webpack is served from C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\public[1] i 「wds」: 404s will fallback to /[1] Starting the development server...[1][1] Error: error:0308010C:digital envelope routines::unsupported[1] at new Hash (node:internal/crypto/hash:69:19)[1] at Object.createHash (node:crypto:133:10)[1] at module.exports (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\util\createHash.js:135:53)[1] at NormalModule._initBuildHash (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:417:16)[1] at handleParseError (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:471:10)[1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:503:5[1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:358:12[1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:373:3[1] at iterateNormalLoaders (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:214:10)[1] at iterateNormalLoaders (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:221:10)[1] C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\react-scripts\scripts\start.js:19[1] throw err;[1] ^[1][1] Error: error:0308010C:digital envelope routines::unsupported[1] at new Hash (node:internal/crypto/hash:69:19)[1] at Object.createHash (node:crypto:133:10)[1] at module.exports (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\util\createHash.js:135:53)[1] at NormalModule._initBuildHash (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:417:16)[1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:452:10[1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\webpack\lib\NormalModule.js:323:13[1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:367:11[1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:233:18[1] at context.callback (C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\loader-runner\lib\LoaderRunner.js:111:13)[1] at C:\Users\sabc1\OneDrive\바탕 화면\boilerplate-mern-stack-master\client\node_modules\babel-loader\lib\index.js:59:103 {[1] opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],[1] library: 'digital envelope routines',[1] reason: 'unsupported',[1] code: 'ERR_OSSL_EVP_UNSUPPORTED'[1] }[1][1] Node.js v18.17.1[1] npm run start --prefix client exited with code 1이런 오류가 뜹니다.node version 이 맞지 않아 생기는 오류 같은데 확인 부탁드려요ㅠㅠ
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 영화 사이트 만들기
모듈이 없다는데요
npm WARN old lockfile npm WARN old lockfile The package-lock.json file was created with an old version of npm,npm WARN old lockfile so supplemental metadata must be fetched from the registry.npm WARN old lockfilenpm WARN old lockfile This is a one-time fix-up, please be patient...npm WARN old lockfilenpm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issuenpm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecatednpm WARN deprecated mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecatednpm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependenciesnpm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecatednpm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecatednpm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properlynpm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the futurenpm ERR! code 1npm ERR! path C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcryptnpm ERR! command failednpm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-buildnpm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)npm ERR! node-pre-gyp info it worked if it ends with oknpm ERR! node-pre-gyp info using node-pre-gyp@0.14.0npm ERR! node-pre-gyp info using node@18.17.1 | win32 | x64npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https downloadnpm ERR! node-pre-gyp info check checked for "C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node" (not found)npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v108-win32-x64-unknown.tar.gznpm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v108-win32-x64-unknown.tar.gznpm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v108-win32-x64-unknown.tar.gznpm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@18.17.1 (node-v108 ABI, unknown) (falling back to source compile with node-gyp)npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v108-win32-x64-unknown.tar.gznpm ERR! gyp info it worked if it ends with oknpm ERR! gyp info using node-gyp@9.3.1npm ERR! gyp info using node@18.17.1 | win32 | x64npm ERR! gyp info oknpm ERR! gyp info it worked if it ends with oknpm ERR! gyp info using node-gyp@9.3.1npm ERR! gyp info using node@18.17.1 | win32 | x64npm ERR! gyp ERR! find Pythonnpm ERR! gyp ERR! find Python Python is not set from command line or npm configurationnpm ERR! gyp ERR! find Python Python is not set from environment variable PYTHONnpm ERR! gyp ERR! find Python checking if "python3" can be usednpm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an errornpm ERR! gyp ERR! find Python checking if "python" can be usednpm ERR! gyp ERR! find Python - "python" is not in PATH or produced an errornpm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python39\python.exenpm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python39\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python39-32\python.exenpm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python39-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python38\python.exenpm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python38\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python38-32\python.exenpm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python38-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python37\python.exenpm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python37\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python37-32\python.exenpm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python37-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python36\python.exenpm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python36\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Users\HB\AppData\Local\Programs\Python\Python36-32\python.exenpm ERR! gyp ERR! find Python - "C:\Users\HB\AppData\Local\Programs\Python\Python36-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exenpm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be runnpm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an errornpm ERR! gyp ERR! find Pythonnpm ERR! gyp ERR! find Python **********************************************************npm ERR! gyp ERR! find Python You need to install the latest version of Python.npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,npm ERR! gyp ERR! find Python you can try one of the following options:npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)npm ERR! gyp ERR! find Python - Set the environment variable PYTHONnpm ERR! gyp ERR! find Python - Set the npm configuration variable python:npm ERR! gyp ERR! find Python npm config set python "C:\Path\To\python.exe"npm ERR! gyp ERR! find Python For more information consult the documentation at:npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installationnpm ERR! gyp ERR! find Python **********************************************************npm ERR! gyp ERR! find Pythonnpm ERR! gyp ERR! configure errornpm ERR! gyp ERR! stack Error: Could not find any Python installation to usenpm ERR! gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)npm ERR! gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21)npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18)npm ERR! gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:294:16)npm ERR! gyp ERR! stack at exithandler (node:child_process:427:5)npm ERR! gyp ERR! stack at ChildProcess.errorhandler (node:child_process:439:5)npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:514:28)npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:289:12)npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:476:16)npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)npm ERR! gyp ERR! System Windows_NT 10.0.19045npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\HB\\Downloads\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\HB\\Downloads\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"npm ERR! gyp ERR! cwd C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcryptnpm ERR! gyp ERR! node -v v18.17.1npm ERR! gyp ERR! node-gyp -v v9.3.1npm ERR! gyp ERR! not oknpm ERR! node-pre-gyp ERR! build errornpm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\node-pre-gyp\lib\util\compile.js:83:29)npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:514:28)npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19045npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HB\\Downloads\\boilerplate-mern-stack-master\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"npm ERR! node-pre-gyp ERR! cwd C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\bcryptnpm ERR! node-pre-gyp ERR! node -v v18.17.1npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.14.0npm ERR! node-pre-gyp ERR! not oknpm ERR! A complete log of this run can be found in: C:\Users\HB\AppData\Local\npm-cache\_logs\2023-08-21T07_28_16_741Z-debug-0.logC:\Users\HB\Downloads\boilerplate-mern-stack-master>npm run dev> react-boiler-plate@1.0.0 dev> concurrently "npm run backend" "npm run start --prefix client"node:internal/modules/cjs/loader:1080 throw err; ^Error: Cannot find module 'C:\Users\HB\Downloads\boilerplate-mern-stack-master\node_modules\concurrently\bin\concurrently.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: []}Node.js v18.17.1
-
해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
타입스크립트 활용 질문
controllers/auth.ts의 passport.authenticate("local", (authError, user, info) => { ...부분에서 콜백함수의 매개변수들에 "매개 변수에는 암시적으로 'any' 형식이 포함됩니다.ts(7006)" 이런 에러가 발생해서const callback: AuthenticateCallback = (authError, user, info) => { ...이렇게 분리해서 타입을 붙여줬고, 매개변수 에러는 없어졌지만 밑에if (!user) { // 로직 실패 (유저가 없을 때) return res.redirect(`/?loginError=${info.message}`); }여기에서 info에선 "(parameter) info: string | object | (string | undefined)[] | undefined개체가 'undefined'인 것 같습니다.ts(2532)" 에러가 뜨고 message에선 "'string | object | (string | undefined)[]' 형식에 'message' 속성이 없습니다.'string' 형식에 'message' 속성이 없습니다.ts(2339)"에러가 떠서if (!user) { // 로직 실패 (유저가 없을 때) const infoWithMessage = info as { message: string }; return res.redirect(`/?loginError=${infoWithMessage.message}`); }이런식으로 타입에러 처리를 해줬습니다.그런데 테스트 코드 짤 때 100%가 나왔다 하더라도 의미없는 테스트 코드를 짤 수 있다고 경고하신 것처럼 이것도 타입스크립트 에러 처리를 해도 타입스크립트를 제대로 활용해서 타입 명시를 한 것인지, 아니면 그냥 에러 지우기만을 위해서 꼼수를 부린 것인지 어떻게 판단해야 할 지 모르겠습니다. 위 경우에 제대로 사용한 것이 맞는지, 어떤 기준으로 제대로 TS를 사용했다 판단하는 것인지 궁금합니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
has,is 통일성
트루,펄스를 논하는 불리안 형태의 변수인 has,is을 한 api안에 has,is을 번갈아 써도 괜찮을까요?is으로만 써야 되거나 has로만 써야 되거나 그런 규칙은 없나요?
-
해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
에러처리 미들웨어 타입 에러
질문1)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"); });이 부분에서 err, req, res, next 매개변수에 각각 "매개 변수에는 암시적으로 'any' 형식이 포함됩니다.ts(7006)" 에러가 떠서const errorHandler: ErrorRequestHandler = (err, req, res, next) => { console.error(err); res.locals.message = err.message; res.locals.error = process.env.NODE_ENV !== 'production' ? err : {}; res.status(err.status || 500); res.render('error'); }; app.use(errorHandler);이런식으로 타입을 달아줬는데 깃허브에선 errorHandler 분리까지만 되어있고 따로 타입을 달아놓지 않았더라고요. 이건 다른 방법으로 처리하셨나요?질문2) @types/express 설치했는데 왜 해당 에러처리 미들웨어에서만 타입 적용이 되지 않은 것이죠?
-
미해결Slack 클론 코딩[백엔드 with NestJS + TypeORM]
설명하시는 소스 git 주소 어디에 있을까요
설명하시는 소스 git 주소 어디에 있을까요커뮤니티 검색해 봤는데 안나오네요...
-
해결됨[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
12.4 room.find is not a function/room.create is not a function 이 출력됩니다.
몽구스 연결하고, 실행하면, 연결성공 메시지까지 뜨는데, 접속하면 room.find is not a function이 출력됩니다. const Room = require('../schemas/room")을 const {Room}이나 const {Room, roomSchema}로 바꾸는 걸 해봐도 해결되진 않습니다.제 생각으로는 schemas/room 과 controller의 index가 제대로 연결되지 않는것으로 보이는데 어떻게 접근하면 좋을까요?