반응형

Programming 211

[vue] mongoose ERROR ServerMiddleware Error: Cannot overwrite User model once compiled.

npm run dev 위의 명령어로 로컬에서 서비스를 띄운 후, 파일을 수정하거나 하면 알아서 hot loading를 해줍니다. 정적인 페이지나 다른 부분은 문제가 없는데 mongoose를 사용중에는 아래와 같은 에러를 만나게 됩니다. ERROR ServerMiddleware Error: Cannot overwrite User model once compiled. 12:23:25 at Mongoose.model (node_modules/mongoose/lib/index.js:506:13) at api/schamas/user.js:42:19 at g (node_modules/jiti/dist/jiti.js:1:55111) at api/routes/signRoute.ts:6:36 at g (node_modu..

Programming/Vue.js 2022.01.22

[ReactNative] iOS, Android 구분하기 (Platform)

ReactNative로 개발을 하다보면 특히 화면을 구성할 때 iOS, Android를 구분해서 다르게 구성하는 경우도 있습니다. 이럴 때 iOS인지 Android인지 구분하는 방법을 알아보겠습니다. import React from 'react'; import {Platform, SafeAreaView, StyleSheet} from 'react-native'; const App = { return ( ); } const styles = StyleSheet.create({ container: { flex: 1, padding: Platform.select({ios: 10, android: 20}) } }); export default App; Platform을 사용하면 운영체제별 다른 값으로 설정하여 운..

[ReactNative] CodePush

2021.07.20 - [Programming/React Native] - [ReactNative] Code push를 위한 App center 연동 [ReactNative] Code push를 위한 App center 연동 CodePush는 MS에서 만든 App Center https://appcenter.ms/ App Center 홈페이지에 가서 가입을 진행한 후 아래와 같이 앱을 등록합니다. 앱을 등록하실 때 본인의 서비스 명칭이 myservice 라고 한다면 꼭 ios는.. marsland.tistory.com 2021.08.03 - [Programming/React Native] - [ReactNative] CodePush 셋팅 [ReactNative] CodePush 셋팅 2021.07.20 ..

[ReaceNative] Expiring Daemon because JVM heap space is exhausted

ReactNative 에서 안드로이드 빌드를하려고 할때 JVM 메모리가 부족해서 빌드에 실패할 경우가 있다. > Task :app:packageRelease FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:packageRelease'. > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable > java.lang.OutOfMemoryError (no error message) * Try: Run with --stacktrac..

[ReactNative] CodePush 셋팅

2021.07.20 - [Programming/React Native] - [ReactNative] Code push를 위한 App center 연동 appcenter login ➜ marsland git:(master) ✗ appcenter login Opening your browser... ? Visit https://appcenter.ms/cli-login?hostname=marsland-ui-MacBookPro.local and enter the code: ? Access code from browser: ${token} Logged in as marsland appcenter login 명령어를 입력하면 브라우저 새로운 탭으로 아래와 같이 하나 열린다. 그 화면에 보이는 token을 복사해서 ..

[ReactNative] Code push를 위한 App center 연동

CodePush는 MS에서 만든 App Center https://appcenter.ms/ App Center 홈페이지에 가서 가입을 진행한 후 아래와 같이 앱을 등록합니다. 앱을 등록하실 때 본인의 서비스 명칭이 myservice라고 한다면 꼭 ios는 myservice-ios, android일 경우에는 myservice-android로 앱 이름을 정하도록 합시다. 나중에 헷갈리지 않게요~ Android 앱 등록 저의 경우에는 ReactNative로 Android 앱을 등록하겠습니다. 앱 등록 후 화면 이제 약간의 설정을 해줘야하는데 매우 심플합니다. npm install appcenter appcenter-analytics appcenter-crashes --save-exact npm을 이용해서 ap..

[CentOS] 프로세스 우아하게 죽이기 (graceful shutdown process)

#!/bin/sh if [ -z "$1" ] then echo "사용법 : gracefulShutdown process" exit fi target=$1 loop=1 limitLoop=30 ps -ef | grep $target | grep -v grep | grep -v vi | grep -v sh | awk '{ print $2 }' | \ while read PID do echo "[$PID] 프로세스에 종료 신호를 전송합니다." kill -15 $PID done while [ $loop -le $limitLoop ] do PID_LIST=(`ps -ef | grep $target | grep -v grep | grep -v vi | grep -v sh | awk '{ print $2 }'`) if..

Programming/CentOS 2021.07.16

[CentOS] n일 지난 톰캣 로그 삭제 및 crontab 등록

n일 경과한 로그파일 검색 [marsland@www:/usr/local/tomcat/service/logs/web] find . -type f -mtime +6 ./allat.log.2020-03-18 ./allat.log.2020-03-23 ./allat.log.2020-04-07 ./root.log.2020-02-21 ./allat.log.2020-03-19 ./root.log.2020-04-15 ./root.log.2020-02-22 ./allat.log.2020-03-24 ./root.log.2020-04-09 ./root.log.2020-02-23 ./allat.log.2020-02-21 ./root.log.2020-03-23 ./root.log.2020-04-10 ./root.log.2020-..

Programming/CentOS 2021.07.15

Flutter 설치 및 개발환경 설정

Flutter에 대한 관심이 많아져 한 번 배워보고자 설치를 해보았습니다. flutter-ko.dev/docs/get-started/install/windows 윈도우에서 설치 flutter-ko.dev 우선 위의 페이지에 들어가서 Flutter SDK 를 다운을 받고 압축을 해제해줍니다. Flutter 폴더/bin 에 들어간 다음 flutter doctor 을 실행하여 설정을 완료하는데 필요한 플랫폼 의존성이 있는지 체크를 합니다. Checking Dart SDK version... Downloading Dart SDK from Flutter engine 2f0af3715217a0c2ada72c717d4ed9178d68f6ed... Unzipping Dart SDK... Building flutter ..

Programming/Flutter 2021.02.23

LocalDate, LocalTime, LocalDateTime

Java Date 관련 흐름순 [java.util.Date](http://java.util.Date) → java.util.Calendar → java.time(org.joda.time) Calender, Date 를 피하는 이유 불변 객체가 아니다 set으로 변경이 가능하다는 점은 누군가 악의적으로 변경할 수 있기 때문에 get/set method에서 직접 Date 클래스를 사용하는 것이 위험하다 Calendar 객체나 Date 객체가 여러 객체에서 공유되면 한 곳에서 바꾼 값이 다른 곳에 영향을 미치는 부작용이 생길 수 있다. C#, Python 같은 언어에서는 날짜 클래스가 한 번 생성된 이후에는 내부 속성을 변경할 수 없다. 상수필드 남용 calendar.add(Calendar.SECOND, 2)..

Programming/JAVA 2020.06.04
반응형