묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
cookie-parser Invalid or unexpected token error
영상에 따라서 단순하게 cookie-parser 설치하고 import cookie-parser 한다음에 app.use(cookieParser()) 진행하면 상단에 이미지처럼 에러가 발생하더라구요. cookie-parser을 제거하면 cookie가 정상적으로 저장되는 것을 볼 수 있었습니다. 어떤 부분을 놓친 것일까요server.tsimport express from "express"; import morgan from "morgan"; import { AppDataSource } from "./data-source" import authRoutes from "./routes/auth"; import subRoutes from "./routes/subs"; import cors from 'cors'; import dotenv from 'dotenv'; import cookieParser from "cookie-parser"; const app = express(); dotenv.config(); app.use(cors({ origin: process.env.ORIGIN, credentials: true })) app.use(express.json()); app.use(morgan('dev')); app.use(cookieParser()) app.get("/", (_, res) => res.send("running")); app.use('/api/auth', authRoutes); app.use("/api/subs", subRoutes); const PORT = process.env.PORT; console.log('PORT', PORT) app.listen(PORT, async () => { console.log(`server running at http://localhost:${PORT}`); AppDataSource.initialize().then(async () => { console.log("data initialize...") }).catch(error => console.log(error)) })
-
해결됨
Keras-yolo3 (FileNotFoundError: [Errno 2] No such file or directory: 'c:/test/images1\\hardhatvest') 에러
keras-yolo3로 학습을 하려고 했는데 도저히 에러 발생에서 해결을 못하겠습니다.... 주피터 노트북에서 실행했습니다"""Retrain the YOLO model for your own dataset."""import osfrom pathlib import PathHOME_DIR = 'C:/test/'ANNO_DIR = 'C:/test/label_xml/'#xml 파일들IMAGE_DIR = 'c:/test/images1/'#이미지 파일들print(ANNO_DIR)print(IMAGE_DIR)files = os.listdir(ANNO_DIR)files2 = os.listdir(IMAGE_DIR)print('파일 개수는:',len(files))print('파일 개수는:',len(files2)) import numpy as npimport tensorflow.keras.backend as Kfrom keras.layers import Input, Lambdafrom keras.models import *from keras.optimizers import Adamfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStoppingfrom tensorflow.python.ops import control_flow_ops import sysLOCAL_PACKAGE_DIR = os.path.abspath("c:/test/SED")sys.path.append(LOCAL_PACKAGE_DIR)from yolo3.model import preprocess_true_boxes, yolo_body, tiny_yolo_body, yolo_lossfrom yolo3.utils import get_random_datafrom train import get_classes, get_anchorsfrom train import create_model, data_generator, data_generator_wrapper annotation_path = 'c:/test/label_xml/annotation.csv'log_dir = 'c:/test/logs/000/'classes_path = 'c:/test/model_data/voc_classes.txt'anchors_path = 'c:/test/model_data/yolo_anchors.txt'class_names = get_classes(classes_path)num_classes = len(class_names)anchors = get_anchors(anchors_path)model_weights_path = 'c:/test/model_data/yolo.h5'input_shape = (416,416) is_tiny_version = len(anchors)==6 # default setting# create_tiny_model(), create_model() 함수의 인자 설정을 원본 train.py에서 수정.if is_tiny_version:model = create_tiny_model(input_shape, anchors, num_classes,freeze_body=2, weights_path=model_weights_path)else:# create_model 은 해당 패키지의 tarin.py 내부에 있는 클래스를 사용했다. 이 함수는 keras 모듈이 많이 사용한다. 우선 모르는 건 pass하고 넘어가자.model = create_model(input_shape, anchors, num_classes,freeze_body=2, weights_path=model_weights_path) # make sure you know what you freeze# epoch 마다 call back 하여 모델 파일 저장.# 이것 또한 Keras에서 많이 사용하는 checkpoint 저장 방식인듯 하다. 우선 이것도 모르지만 넘어가자.logging = TensorBoard(log_dir=log_dir)checkpoint = ModelCheckpoint(log_dir + 'ep{epoch:03d}-loss{loss:.3f}-val_loss{val_loss:.3f}.h5',monitor='val_loss', save_weights_only=True, save_best_only=True, period=3)reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=3, verbose=1)early_stopping = EarlyStopping(monitor='val_loss', min_delta=0, patience=10, verbose=1) val_split = 0.1 # train data : val_data = 9 : 1with open(annotation_path) as f:# 이러니 annotation 파일이 txt이든 csv이든 상관없었다.lines = f.readlines()# 랜덤 시드 생성 및 lines 셔플하기np.random.seed(10101)np.random.shuffle(lines)np.random.seed(None)# 데이터셋 나누기num_val = int(len(lines)*val_split)num_train = len(lines) - num_val # 여기서 부터 진짜 학습 시작!# create_model() 로 반환된 yolo모델에서 trainable=False로 되어 있는 layer들 제외하고 학습if True:# optimizer와 loss 함수 정의# 위에서 사용한 create_model 클래스의 맴버함수를 사용한다.model.compile(optimizer=Adam(lr=1e-3), loss={# use custom yolo_loss Lambda layer.'yolo_loss': lambda y_true, y_pred: y_pred})batch_size = 4print('Train on {} samples, val on {} samples, with batch size {}.'.format(num_train, num_val, batch_size)) # foward -> backpropagation -> weight 갱신 -> weight 저장# checkpoint 만드는 것은 뭔지 모르겠으니 pass...model.fit_generator(data_generator_wrapper(lines[:num_train], batch_size, input_shape, anchors, num_classes),steps_per_epoch=max(1, num_train//batch_size),validation_data=data_generator_wrapper(lines[num_train:], batch_size, input_shape, anchors, num_classes),validation_steps=max(1, num_val//batch_size),epochs=50,initial_epoch=0,callbacks=[logging, checkpoint])model.save_weights(log_dir + 'trained_weights_stage_1.h5')# create_model() 로 반환된 yolo모델에서 trainable=False로 되어 있는 layer들 없이, 모두 True로 만들고 다시 학습if True:for i in range(len(model.layers)):model.layers[i].trainable = Truemodel.compile(optimizer=Adam(lr=1e-4), loss={'yolo_loss': lambda y_true, y_pred: y_pred}) # recompile to apply the changeprint('Unfreeze all of the layers.')batch_size = 4 # note that more GPU memory is required after unfreezing the bodyprint('Train on {} samples, val on {} samples, with batch size {}.'.format(num_train, num_val, batch_size))model.fit_generator(data_generator_wrapper(lines[:num_train], batch_size, input_shape, anchors, num_classes),steps_per_epoch=max(1, num_train//batch_size),validation_data=data_generator_wrapper(lines[num_train:], batch_size, input_shape, anchors, num_classes),validation_steps=max(1, num_val//batch_size),epochs=100,initial_epoch=50,callbacks=[logging, checkpoint, reduce_lr, early_stopping])model.save_weights(log_dir + 'trained_weights_final.h5')이렇게 해주고 실행을 했습니다. 이미지 경로도 제대로 설정해줬는데 파일이나 폴더를 찾을 수가 없다고 하는데 어떻게 해주어야 할까요....저 images1 폴더를 다른 이름으로 수정하거나 없애도 경로가 계속 'c:/test/images1\\hardhatvest' 이곳을 가리킵니다. Train on 29 samples, val on 3 samples, with batch size 4. Epoch 1/50 --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_20040\2424985784.py in <module> 20 epochs=50, 21 initial_epoch=0, ---> 22 callbacks=[logging, checkpoint]) 23 model.save_weights(log_dir + 'trained_weights_stage_1.h5') 24 ~\anaconda3\envs\test\lib\site-packages\keras\legacy\interfaces.py in wrapper(*args, **kwargs) 89 warnings.warn('Update your `' + object_name + '` call to the ' + 90 'Keras 2 API: ' + signature, stacklevel=2) ---> 91 return func(*args, **kwargs) 92 wrapper._original_function = func 93 return wrapper ~\anaconda3\envs\test\lib\site-packages\keras\engine\training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch) 1730 use_multiprocessing=use_multiprocessing, 1731 shuffle=shuffle, -> 1732 initial_epoch=initial_epoch) 1733 1734 @interfaces.legacy_generator_methods_support ~\anaconda3\envs\test\lib\site-packages\keras\engine\training_generator.py in fit_generator(model, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch) 183 batch_index = 0 184 while steps_done < steps_per_epoch: --> 185 generator_output = next(output_generator) 186 187 if not hasattr(generator_output, '__len__'): ~\anaconda3\envs\test\lib\site-packages\keras\utils\data_utils.py in get(self) 740 "`use_multiprocessing=False, workers > 1`." 741 "For more information see issue #1638.") --> 742 six.reraise(*sys.exc_info()) ~\anaconda3\envs\test\lib\site-packages\six.py in reraise(tp, value, tb) 717 if value.__traceback__ is not tb: 718 raise value.with_traceback(tb) --> 719 raise value 720 finally: 721 value = None ~\anaconda3\envs\test\lib\site-packages\keras\utils\data_utils.py in get(self) 709 try: 710 future = self.queue.get(block=True) --> 711 inputs = future.get(timeout=30) 712 self.queue.task_done() 713 except mp.TimeoutError: ~\anaconda3\envs\test\lib\multiprocessing\pool.py in get(self, timeout) 655 return self._value 656 else: --> 657 raise self._value 658 659 def _set(self, i, obj): ~\anaconda3\envs\test\lib\multiprocessing\pool.py in worker(inqueue, outqueue, initializer, initargs, maxtasks, wrap_exception) 119 job, i, func, args, kwds = task 120 try: --> 121 result = (True, func(*args, **kwds)) 122 except Exception as e: 123 if wrap_exception and func is not _helper_reraises_exception: ~\anaconda3\envs\test\lib\site-packages\keras\utils\data_utils.py in next_sample(uid) 648 The next value of generator `uid`. 649 """ --> 650 return six.next(_SHARED_SEQUENCES[uid]) 651 652 c:\test\train.py in data_generator(annotation_lines, batch_size, input_shape, anchors, num_classes) 177 if i==0: 178 np.random.shuffle(annotation_lines) --> 179 image, box = get_random_data(annotation_lines[i], input_shape, random=True) 180 image_data.append(image) 181 box_data.append(box) c:\test\yolo3\utils.py in get_random_data(annotation_line, input_shape, random, max_boxes, jitter, hue, sat, val, proc_img) 37 '''random preprocessing for real-time data augmentation''' 38 line = annotation_line.split() ---> 39 image = Image.open(line[0]) 40 iw, ih = image.size 41 h, w = input_shape ~\anaconda3\envs\test\lib\site-packages\PIL\Image.py in open(fp, mode, formats) 3090 3091 if filename: -> 3092 fp = builtins.open(filename, "rb") 3093 exclusive_fp = True 3094 FileNotFoundError: [Errno 2] No such file or directory: 'c:/test/images1\\hardhatvest'
-
미해결풀스택을 위한 도커와 최신 서버 기술(리눅스, nginx, AWS, HTTPS, 배포까지) [풀스택 Part3]
도커 강의자료 문의(메일 보냈으나 권한 부여가 안되어 있는 것 같습니다)
안녕하세요.강의자료를 사전에 '수업준비' 챕터에서 받았는데,본 docker 챕터부터 강의자료가 없는것 같아요.아니면, 강의자료가 다른곳에 첨부되어 있을까요?권한 부여된 자료를 어디서 확인할 수 있는지 모르겠습니다. 메일은 2021. 12. 26. 오후 2:03에 보냈습니다. 혹시 몰라서 오늘 다시 보냈습니다.확인 한번만 부탁드립니다. 인프런 아이디hajuny129@gmail.com구글 이메일hajuny129@gmail.com
-
미해결[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!
GO router 관련 질문.
안녕하세요, 수업내용 중 에러발생하여 글 작성합니다.go router를 프로젝트에 적용하는 수업을 듣는데, 적용 후 하기와 같은 에러가 발생 했습니다.'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2918 pos 12: 'route._navigator == navigator': is not true.오타가 있을까봐 관련 수업들 전부 2,3번 보았지만 오타는 없었습니다. 찾아보니 리다이렉트가 2번실행되는 상황들이 있다고 해서 redirect를 없애고 실행하니 잘되었습니다. 에러발생 사유와 어떻게 방지해야되는지 알 수있을까요?
-
미해결Vue.js + TypeScript 완벽 가이드
권한요청 드립니다.
권한요청 드립니다. lcg5320@gmail.com
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
2강 npm install 오류
안녕하세요 강사님2강을 듣는중 boilerplace-mern stack master을 다운받고 압축해제를 한 후npm install을 하는데 이러한 오류가 나옵니다.Windows PowerShellCopyright (C) Microsoft Corporation. All rights reserved.새로운 크로스 플랫폼 PowerShell 사용 https://aka.ms/pscore6PS C:\Users\park\Documents\boilerplate-mern-stack-master> npm installnpm WARN old lockfilenpm 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 lockfile npm WARN old lockfile This is a one-time fix-up, please be patient...npm WARN old lockfile npm 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\park\Documents\boilerplate-mern-stack-master\node_modules\bcryptnpm ERR! command failednpm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c C:\Users\park\AppData\Local\Temp\install-8386daeb.cmdnpm 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\park\Documents\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\park\Documents\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (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@16.17.0 | 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\park\Documents\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-v93-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-v93-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-v93-win32-x64-unknown.tar.gznpm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@16.17.0 (node-v93 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-v93-win32-x64-unknown.tar.gznpm ERR! gyp info it worked if it ends with oknpm ERR! gyp info using node-gyp@9.0.0npm ERR! gyp info using node@16.17.0 | win32 | x64npm ERR! gyp info oknpm ERR! gyp info it worked if it ends with oknpm ERR! gyp info using node-gyp@9.0.0npm ERR! gyp info using node@16.17.0 | win32 | x64npm ERR! gyp ERR! find Python npm 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\park\AppData\Local\Programs\Python\Python39\python.exenpm ERR! gyp ERR! find Python - "C:\Users\park\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\park\AppData\Local\Programs\Python\Python39-32\python.exenpm ERR! gyp ERR! find Python - "C:\Users\park\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\park\AppData\Local\Programs\Python\Python38\python.exenpm ERR! gyp ERR! find Python - "C:\Users\park\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\park\AppData\Local\Programs\Python\Python38-32\python.exenpm ERR! gyp ERR! find Python - "C:\Users\park\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\park\AppData\Local\Programs\Python\Python37\python.exenpm ERR! gyp ERR! find Python - "C:\Users\park\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\park\AppData\Local\Programs\Python\Python37-32\python.exenpm ERR! gyp ERR! find Python - "C:\Users\park\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\park\AppData\Local\Programs\Python\Python36\python.exenpm ERR! gyp ERR! find Python - "C:\Users\park\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\park\AppData\Local\Programs\Python\Python36-32\python.exenpm ERR! gyp ERR! find Python - "C:\Users\park\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:408:5)npm ERR! gyp ERR! stack at ChildProcess.errorhandler (node:child_process:420:5)npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:478:16)npm ERR! gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21)npm ERR! gyp ERR! System Windows_NT 10.0.19044npm 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\\park\\Documents\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\park\\Documents\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"npm ERR! gyp ERR! cwd C:\Users\park\Documents\boilerplate-mern-stack-master\node_modules\bcryptnpm ERR! gyp ERR! node -v v16.17.0api_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\park\Documents\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:513:28)npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1093:16)npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19044npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\park\\Documents\\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\park\Documents\boilerplate-mern-stack-master\node_modules\bcryptnpm ERR! node-pre-gyp ERR! node -v v16.17.0npm 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:npm ERR! C:\Users\park\AppData\Local\npm-cache\_logs\2022-09-28T10_16_33_214Z-debug-0.logPS C:\Users\park\Documents\boilerplate-mern-stack-master> 이유를 알 수 있을까요..ㅠㅠ 답변 기다리고 있습니다..ㅠㅠㅠ 처음부터 이래버려서 진도를 나갈수가 없어요 흑흑
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
주문한 상품 종류 수
지금 저희가 하는 코드에서7분07초쯤 expected가 1밖에 될 수 없는건가요?
-
해결됨앨런 iOS Concurrency(동시성) - 디스패치큐와 오퍼레이션큐의 이해
교착상태 발생 가능성
안녕하세요! 강의 수강 중 질문 있어 글을 남깁니다.'교착상태의 다양한 발생 가능성' 부분을 보고 있습니다.그 중 첫 번째가 '동기 작업이 현재의 쓰레드를 필요로 하는 경우'입니다. 이 부분은 3-2 강의를 참고해서 이해를 했는데요. 아래처럼 비동기로 작업을 보냈는데, 자신을 block시킨 global queue에 할당되어 교착된 상태입니다.DispatchQueue.global().async { DispatchQueue.global().sync { ... } }두 번째가 '앞선 작업이 현재 쓰레드를 필요로 하는 경우'인데요, 생각해보니 위의 케이스를 제외하고는 마땅한 경우가 떠오르지 않아서요! 혹시 첫 번째 상황과 같은 것을 의미하는지, 제가 설명한 부분이 맞는 말인지 궁금합니다. 감사합니다! :)
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
+=나 -=연산자를 사용하는 것과 덧셈/뺄셈 후 할당하는 것의 차이가 있을까요?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.http://boj.kr/e083acd670f1478bad5c88f07da76de7복합대입연산자를 쓰면 중간에 자꾸 이상한 에러가 납니다.백준의 첫 번째 예제의 경우에도 Dev c++에서 테스트해 보면Onrxwbba Bayvar W굌tr이런 식으로 문자가 깨지는 경우가 발생합니다. 왜 이렇게 되는 건가요?
-
미해결배달앱 클론코딩 [with React Native]
타입스크립트 제네릭
타입스크립트 질문이 있습니다. 제네릭은 코드의 재사용을 높이기 위해서, 함수를 생성할때 매개변수의 타입을 정하는 것이라고 알고 있습니다. const f =<T>(param :T):T =>{…}이렇게요.그런데 navigation을 사용하는 것과 같은 경우에는const Tab = createBottomTabNavigator<TabParamList>()와 같이 매개변수나 반환값에 TabParamList라는 타입이 사용되지 않음에도 불구하고 제네릭을 사용합니다한가지 함수를 재사용하는 목적이 없다고 볼 수 있는 것 같은데, 저기서 제네릭의 역할이 무엇인지 궁금합니다
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
라우트 호출 원리가 궁금합니다.
<Route exact path="/" element={<Home />} />위 방식으로 제가 작성하여 function Home() { console.log('>>>>> home'); return ( <div> <h2>Home</h2> </div> ); }아래처럼 로그를 주었는데 개발자도구에서 확인 시 로그가 두번씩 호출이 됩니다. 어떻게 두번이 호출 되는지와 exact 속성의 역할element={<Home />}와 element={Home()}의 차이점이 궁금합니다.
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
1-G 반례 질문입니다
https://www.acmicpc.net/source/49806907 Split()을 썼는데 강의를 보니 *이 한 번만 나오니 find()를 쓰면 됐을걸 그랬습니다.궁금한 점은 s.erase()로 접두사와 접미사 전까지의 문자열을 다 삭제하였기 때문에 강의에서처럼 접두사+접미사의 길이보다 작은 문자열은 배제substr은 아니지만 find를 통해 접두사/접미사가 문자열의 양 끝에 존재하는지 확인하였는데 틀렸는지 잘 모르겠습니다..백준 질문검색 기준 반례들을 다 테스트 해봐서 통과했으며 채점 10%에서 틀렸다고 나옵니다.
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
scss @debug 출력
안녕하세요..scss 를 사용하고 있는데, @debug 가 출력이 되지 않습니다...stats: { loggingDebug: ['sass-loader']}위 구문을 webpack.config.js 에 추가하라고 해서, vue.config.js에 추가를 했습니다.그래도 콘솔에 출력이 되지 않습니다.다른 방법이 있을까요?도움을 부탁 드립니다.
-
미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
네이버 api 요청 관련 질문 있습니다
네이버 api 요청 관련 질문 있습니다github:https://github.com/hyunsokstar/naver-add-prototype back:npm run start:dev front:npm run dev controller 에서 http://localhost:8000/naver_add 요청을 받으면 네이버 광고에 api 요청(https://naver.github.io/searchad-apidoc/#/guides) 을 날려서 응답 받은걸 다시 프론트로 보내려고 하는데요 참고 문서는 https://ukcasso.tistory.com/99 이고 컨트롤러와 서비스는 다음과 같습니다.https://github.com/hyunsokstar/naver-add-prototype/blob/main/backend/src/naver_add/naver_add.controller.tshttps://github.com/hyunsokstar/naver-add-prototype/blob/main/backend/src/naver_add/naver_add.service.ts 그런데 헤더 설정이 잘못되어서인지 import { NaverAddService } from './naver_add.service';import { SuccessInterceptor } from './../common/interceptors/success.interceptor';import { Controller, Get, Req, UseInterceptors } from '@nestjs/common';// import CryptoJS from "crypto-js";import * as CryptoJS from 'crypto-js'var method = "GET";var api_url = "/keywordstool";var timestamp = Date.now() + '';const accessKey = "01000000000f85a84ea950600f3a5a2214f5f379afa3f09898cbf7a1699007c1167fe2e247"var secretKey = "AQAAAAAPhahOqVBgDzpaIhT183mv52WgZFJyJCX8PE87IzXJwg==";var method = "GET";var timestamp = Date.now() + '';var secretKey = "YOUR_SECRETKEY";var hmac = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, secretKey);hmac.update(timestamp + '.' + method + '.' + api_url);var hash = hmac.finalize();hash.toString(CryptoJS.enc.Base64);@Controller('naver_add')@UseInterceptors(SuccessInterceptor)export class NaverAddController { constructor( private readonly naverAddService: NaverAddService ) { } @Get() getNaverAddInfo() { const api_key = process.env.API_KEY; const secret_key = process.env.SECRET_KEY; const customer_id = process.env.CUSTOMER_ID; const options = { url: 'https://api.naver.com/keywordstool?hintKeywords=' + "skilnote" + '&showDetail=1', headers: { 'X-Timestamp': timestamp, 'X-API-KEY': api_key, 'X-API-SECRET': secret_key, 'X-CUSTOMER': customer_id, 'X-Signature': hash.toString(CryptoJS.enc.Base64) } }; // const result = this.naverAddService.getNaverAddInfo(options).subscribe( // res => { // console.log(res); // }); const result = this.naverAddService.getNaverAddInfo(options).pipe().subscribe() console.log("result : ", result); // return result }} 요청 자체는 성공으로 출력 되지만 콘솔에 이런 에러가 발생 합니다. http://www.skilnote-for-starter.shop/wm/myshortcut/trouble-shotting/1혹시 해결 방법 알려주시면 감사요 그리고 혹시 멘토링 같은건 안해주시나요 주말이든 주중이든 채팅이나 직접 만나서든 배우고 싶습니다.
-
미해결따라하며 배우는 도커와 CI환경 [2023.11 업데이트]
COPY failed: stat app/build: file does not exist
Docker fullstack appgithub -> travis ci -> docker hub -> aws강의에서 travis ci에서5.28s$ docker build -t [secure]/docker-frontend ./frontend진행시 오류가 납니다.Step 10/10 : COPY --from=builder /app/build /usr/share/nginx/html320COPY failed: stat app/build: file does not existDockerfile 내용FROM node:alpine as builder WORKDIR /app COPY ./package.json ./ RUN npm install COPY ./ ./ CMD npm run build FROM nginx EXPOSE 3000 COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf COPY --from=builder /app/build /usr/share/nginx/html
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
getline 질문드립니다.
안녕하세요오split 관련 문제를 풀어보고 싶어서 찾아보던 중, 백준 9093번 문제를 발견하게 되어 풀어보았습니다!공백을 포함해서 받아야 해서 getline을 통해 여러번 입력을 받으려니 cin.ignore()를 해야만 가능한 것 같아서 사용해보았는데요, 질문은 다음과 같습니다!▼ 입력3 I am happy today We want to win the first prize hello world!▼ 출력 시 코드 결과I ma yppah yadot e tnaw ot niw eht tsrif ezirp olle !dlrow원하는 결과는eW tnaw ot niw eht tsrif ezirpolleh !dlrow 인데,코드를 돌려보니 문자열이 뒤집혀서 출력되는 것은 원했던 바가 맞는데, 보시다시피 2번째 문자열부터 맨 앞글자가 하나씩 빠지는 문제가 있었습니다.코드를 어떻게 수정해야 원하는 결과가 나올지 궁금합니다!전체 코드#include <bits/stdc++.h> using namespace std; vector<string> split(string s, string delimiter){ string token = ""; int pos; vector<string> str; while( (pos = s.find(delimiter)) != string::npos ){ token = s.substr(0, pos); reverse(token.begin(), token.end()); token += " "; str.push_back(token); s.erase(0, pos + 1); } reverse(s.begin(), s.end()); str.push_back(s); return str; } int main(){ ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; while(n){ string s; cin.ignore(); getline(cin, s); vector<string> s2 = split(s," "); for(auto i : s2){ cout << i; } cout << "\n"; n--; } return 0; }
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
모달창이 안뜹니다.
import 'package:calendar_scheduler/component/custom_text_feild.dart'; import 'package:calendar_scheduler/const/colors.dart'; import 'package:calendar_scheduler/database/drift_database.dart'; import 'package:calendar_scheduler/model/category_color.dart'; import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; import 'package:calendar_scheduler/database/drift_database.dart'; class ScheduleBottomSheet extends StatefulWidget { //form 3. StatefulWidget이어야한다. const ScheduleBottomSheet({Key? key}) : super(key: key); @override State<ScheduleBottomSheet> createState() => _ScheduleBottomSheetState(); } class _ScheduleBottomSheetState extends State<ScheduleBottomSheet> { final GlobalKey<FormState> formKey = GlobalKey(); //form 4. formKey변수만들어준다. int? startTime; //3개의 값을 반복적으로 사용하기 위해 저장을한다. int? endTime; String? content; int? selectedColorId; //color를 id로 관리하기 위해 id값을 넣기 위해 변수를 만든다. @override Widget build(BuildContext context) { final bottomInset = MediaQuery.of(context).viewInsets.bottom; //키보드같은 시스템의 높이를 알 수 있음. 상하좌우 가능 return GestureDetector( onTap: (){ FocusScope.of(context).requestFocus(FocusNode()); }, child: SafeArea( child: Container( color: Colors.white, height: MediaQuery.of(context).size.height /2 + bottomInset, //핸드폰 전체높이에 /2 절반 child: Padding( padding: EdgeInsets.only(bottom: bottomInset), child: Padding( padding: EdgeInsets.only(left: 8.0, right: 8.0, top: 16.0), child: Form( //form 2. _Time,_Content 이거 있는거 상위에 form을 해준다. key가 컨트롤러가 된다. key: formKey, //form 5. formKey변수 넣어준다. 컨트롤러가 된다. autovalidateMode: AutovalidateMode.always, //에러메시지를 실시간 표현해줌. child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ _Time( onStartSaved: (String? val){ startTime = int.parse(val!); //String으로 값이 들어오니 int로 파싱 그걸 위에서 만든 변수에 넣는다. }, onEndSaved: (String? val){ endTime = int.parse(val!); //val이 값이 없으면 에러메시지뜨도록 했으니 값이 없을수 없다. }, ), SizedBox(height: 16.0,), _Content( onSaved: (String? val){ content = val; //String이니 걍 넣는다. }, ), SizedBox(height: 16.0,), FutureBuilder<List<CategoryColor>>( future: GetIt.I<LocalDatabase>().getCategoryColors(), //디비가져오기 4 이페이지에서 디비값 가져올수 있게 세팅, LocalDatabase이거는 drift_database파일에서 import builder: (context, snapshot) { //print(snapshot.data); //디비가져오기 5 디비에서 가져온 색깔 출력 if(snapshot.hasData && selectedColorId == null && snapshot.data!.isNotEmpty){ //if(데이터가 있고, selectedColorId를 클릭하지 않았음, 하나라도 값이 있거나) selectedColorId = snapshot.data![0].id; //0번째 빨강색으로 셀렉트 한다. } return _ColorPicker( colors: snapshot.hasData ? snapshot.data! : [], //디비가져오기 6 hasData 값이 있으면 .hasData 값이 없으면 : [] 걍 빈값을 보낸다. selectedColorId: selectedColorId!, ); } ), SizedBox(height: 8.0,), _SaveButton(onPressed: onSavePressed,), //form 7 onSavePressed 함수 만든다. ], ), ), ), ), ), ), ); } void onSavePressed(){ if(formKey.currentState == null){ //현재 null이 나올수는 없으나 혹시나 null인경우 그냥 리턴해 버린다. return; } if(formKey.currentState!.validate()){ //form 8 에러가 없으면 null값을 리턴하면서 true print('에러 없음'); formKey.currentState!.save(); print('--------------------'); print('startTime : $startTime'); print('endTime : $endTime'); print('content : $content'); }else{ print('에러 있음'); } } } class _SaveButton extends StatelessWidget { final VoidCallback onPressed; const _SaveButton({required this.onPressed, Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Row( children: [ Expanded( child: ElevatedButton( onPressed: onPressed, //form 6 외부로 보낼수 있게 required 만든다. style: ElevatedButton.styleFrom( primary: PRIMARY_COLOR, ), child: Text('저장'), ), ), ], ); } } class _ColorPicker extends StatelessWidget { final List<CategoryColor> colors; //디비가져오기 1.디비에 있는 칼라를 이걸로 가져올 거임 final int selectedColorId; // 아이디 값을 받아준다. const _ColorPicker({ required this.colors, required this.selectedColorId, Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Wrap( spacing: 8.0, //좌우간격 runSpacing: 10.0, //상하 간격 children: colors.map((e) => renderColor(e, selectedColorId == e.id)).toList(), //디비가져오기 2. colors값 렌더링하기 ->main에서 GetIt한다. //여기 e=<CategoryColor> ); } Widget renderColor(CategoryColor color, bool isSelected){ return Container( decoration: BoxDecoration( shape: BoxShape.circle, color: Color( int.parse( 'FF${color.hexCode}', //hexCode 컬럼에 있는 값을 가져온다. radix: 16, //16진수로 표현한다. ), ), border: isSelected //선택 되었을대 보더를 넣어준다. ? Border.all( color: Colors.black, width: 4.0, ) : null, ), height: 32.0, width: 32.0, ); } } class _Content extends StatelessWidget { final FormFieldSetter<String> onSaved; const _Content({required this.onSaved, Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Expanded( //1.텍스필드 꽉차게 다음은 custom_text_feild에 child: CustomTextField( label: '내용', isTime: false, onSaved: onSaved, ), ); } } class _Time extends StatelessWidget { final FormFieldSetter<String> onStartSaved; final FormFieldSetter<String> onEndSaved; const _Time({ required this.onStartSaved, required this.onEndSaved, Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Row( children: [ Expanded( child: CustomTextField( label: '시작시간', isTime: true, onSaved: onStartSaved, ), ), SizedBox(width: 8.0,), Expanded( child: CustomTextField( label: '종료시간', isTime: true, onSaved: onEndSaved, ), ), ], ); } } 초급 섹션 19. [프로젝트] [★★★★☆] 캘린더 스케쥴러에 > 색상 상태관리 강의 따라 하고 있습니다.그런데 3:25초 부분에서 selectedColorId: selectedColorId!, 만 넣으면 아래 그림처럼 모달창이 안뜹니다. 몇번을 다시 하고 해봤는데 원인을 모르겠습니다.schedule_bottom_sheet.dart 파일 입니다.
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
v3 savecontroller member 에러,오류
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)[질문 내용]여기에 질문 내용을 남겨주세요.마지막 줄 member에 빨간줄 에러가 뜨는데 해결법을 모르겠습니다..
-
미해결Jenkins를 이용한 CI/CD Pipeline 구축
컨테이너 내부에서 도커 실행 시 오류 발생하시는 분들
컨테이너 내에서 도커가 실행되지 않아 진행하지 못하는 분들이 꽤 보이네요.강사님이 게시하신 DinD 방식 대신 DooD 방식으로 실행하여 진행하실 수 있습니다. 다만 DooD 방식 특성으로 인해 포트 바인딩에 조금 신경 써주셔야 합니다.아래는 Ansible 강의 컨테이너 실행 명령입니다.docker run -itd -p 20022:22 -e container=docker --tmpfs /run --tmpfs /tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /var/run/docker.sock:/var/run/docker.sock edowon0623/ansible:latest /usr/sbin/init앞선 강의에서 등장하는 docker-server 컨테이너 등 컨테이너 내부에서 도커 실행 시 오류가 발생하는 다른 컨테이너들도 이미지랑 포트만 변경하여 실행하시면 됩니다. Windows 강의 진행 시 이슈를 기억나는 대로 정리했습니다.https://www.inflearn.com/chats/662870
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
memberservice not found 에러
.Bean을 직접 등록하고 다음강의로 넘어가서 실행 해보려는데 멤버서비스를 찾을수없다고 에러가 발생하네요... 제가 직접 찾아보는게 좋을것같아서 보려고 하지만 아직 부족한 부분이 많은지 보이질 않아요... 어딜 손대야할까요?