728x90

출처

https://ddolcat.tistory.com/26

http://blog.naver.com/PostView.nhn?blogId=netrance&logNo=221224761858&parentCategoryNo=&categoryNo=95&viewDate=&isShowPopularPosts=true&from=search

 

 

앱을 삭제했을 때 shared preference 데이터를 삭제하는 방법
How to remove shared preference while application uninstall in android

 

앱을 삭제 후 재설치하게 되면 공유환경 설정(shared preference)에서 일부 데이터가 복원되는 증상이 요즈음 나온 최신 폰에서 발생하고 있습니다.

즉, 앱을 삭제 후 재설치하면, 삭제 전에 저장되었던 자료들이 남아있는 문제가 발견되고 있습니다.

 

원인은 바로 자동 백업 "BackupManager" 때문 -- android:allowBackup 속성 true로 자동 설정

Android API 23(또는 Android "6.0" 또는 Android "Marshmellow")이후 BackupManager는 공유 환경 설정을 포함한 앱의 모든 데이터를 클라우드에 저장합니다.

이는 안드로이드 6.0부터는 AndroidManifest.xml 파일에서 application 요소의 android:allowBackup 속성을 명시하지 않으면 자동으로 true로 설정하기 때문인데 이로 인해 사용자도 모르게 데이터가 구글 클라우드에 자동으로 백업됩니다.

 

결국 앱 삭제 후 재설치하면, 자료가 자동으로 복원되다 보니 환경설정(preferences)에 저장된 자료가 되살아 나는 것입니다.

 


해결방법

 

1. 안드로이드 폰에서 직접 해제 하는 방법이 있습니다.
   설정 > 백업 및 재설정 > 자동복원을 선택, 자동복원 해제 를 하는 방법입니다.
   그러나 이 방법은 장치에 설치된 모든 응용 프로그램의 자동 백업기능을 해제하기 때문에 권장하지 않습니다.


2. 앱 소스에서 매니페스트 파일로 이동, application 태그에서 "allowBackup" 속성을 찾아서 false로 설정하는 것입니다.

 


앱의 데이터 자동 백업을 막는 방법

 

1. AndroidManifest.xml 파일을 여세요.

 

2. application 요소에 android:allowBackup 요소를 추가하고, 값을 false로 설정하세요.

android:allowBackup="false"

 

3. application 요소에 android:fullBackupContent 요소를 추가하고, 값을 false로 설정하세요.

android:fullBackupContent="false"

 

4. (옵션) 프로젝트에 다른 플러그인이 있는 경우, allowBackup 속성이 충돌할 수 있습니다.

    이 경우 application 요소에 tools:replace 속성을 추가하고, 값은 "android:allowBackup"으로 설정합니다.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="패키지명">

    <uses-feature
        android:name="android.hardware.camera"
        android:required="true"/>

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>


......


    <application
        android:name=".MyApp"

        android:allowBackup="false"
        android:fullBackupContent="false"
        tools:replace="android:allowBackup"
        
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        tools:replace="android:icon">

......


    </application>

</manifest>

 

참고로 android:fullbackupOnly="false" 기능은 안드로이드 API 21 이후 폰에서 설정, 사용가능합니다.

 

 

<기타 참고 사이트>

https://stackoverflow.com/questions/33169618/an-android-app-remembers-its-data-after-uninstall-and-reinstall

https://developer.android.com/guide/topics/data/autobackup.html

http://androbook.tistory.com/entry/%EB%8B%A4%EC%8B%9C-%EC%82%B4%ED%8E%B4%EB%B3%B4%EB%8A%94-%EB%A7%A4%EB%8B%88%ED%8E%98%EC%8A%A4%ED%8A%B8-%EC%86%8D%EC%84%B1%EB%93%A4

 

728x90

참고 URL : gmlwjd9405.github.io/2018/05/25/git-add-cancle.html

 

git으로 commit 을 하는데 잘못 commit 하였다면 취소할 수 있습니다.

각 단계별로 취소하는 방법이 있습니다.

 

1. git add를 취소할 수 있다.
2. git commit을 취소할 수 있다.
3. git push를 취소할 수 있다.
4. untracked 파일을 삭제할 수 있다.

 

intelij 에서 git commit을 하는 경우 Rollback..으로 할 수 있으나 Terminal 을 열어서 하는게 더 나을 수도 있습니다.

 


git add 취소하기 (파일 상태를 Unstage로 변경하기)

 

$ git reset HEAD

 

아래와 같이 실수로 git add * 명령을 사용하여 모든 파일을 Staging Area에 넣는 경우가 발생하였다면 

$ git add *
// 파일들의 상태를 확인한다.
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
  renamed:    README.md -> README
  modified:   CONTRIBUTING.md

 

 

뒤에 파일명이 없으면 add한 파일 전체를 취소할 수 있습니다.

$ git reset HEAD
// 파일들의 상태를 확인한다.

$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
........

 

git add 한 파일중에서 README 파일을 Unstage로 변경할 수 있습니다.

$ git reset HEAD 파일명

$ git reset HEAD README
Unstaged changes after reset:
M	README


-- 파일들의 상태를 확인합니다.

$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
  renamed:    README.md -> README
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
  modified:   README

 


git commit 취소하기  (git reset HEAD^)

 

commit이 완료된 경우 취소할 수 있습니다.
어떤 파일을 빼먹고 commit한 경우나 너무 일찍 commit 한 경우 등에서

git reset HEAD^ 명령어를 통해 git commit을 취소할 수 있습니다.

-- commit 목록 확인을 확인합니다.
$ git log



-- 1. commit을 취소하고 해당 파일들은 staged 상태로 유지하고, 워킹 디렉터리에 보존합니다.
$ git reset --soft HEAD^



-- 2. commit을 취소하고 해당 파일들은 unstaged 상태로 변경하고, 워킹 디렉터리에 보존합니다.
$ git reset --mixed HEAD^ // 기본 옵션
$ git reset HEAD^         // 위와 동일
$ git reset HEAD~2        // 마지막 2개의 commit을 취소



-- 3. commit을 취소하고 해당 파일들은 unstaged 상태로 변경하고, 워킹 디렉터리에서도 삭제합니다.
$ git reset --hard HEAD^

 

(실제 사용한 예)

$ git reset HEAD^
리셋 뒤에 스테이징하지 않은 변경 사항:
M       ...........
M       .....


$

 

 

git reset 명령은 아래의 옵션과 관련해서 주의하여 사용해야 합니다.

 

reset 옵션

–soft : index 보존(add한 상태, staged 상태), 워킹 디렉터리의 파일 보존. 즉 모두 보존.
–mixed : index 취소(add하기 전 상태, unstaged 상태), 워킹 디렉터리의 파일 보존 (기본 옵션)
–hard : index 취소(add하기 전 상태, unstaged 상태), 워킹 디렉터리의 파일 삭제. 즉 모두 취소.

 

 

만약 워킹 디렉터리를 원격 저장소의 마지막 commit 상태로 되돌리고 싶으면, 아래의 명령어를 사용해야 합니다.

단, 이 명령을 사용하면 원격 저장소에 있는 마지막 commit 이후의 워킹 디렉터리와 add했던 파일들이 모두 사라지므로 주의해야 합니다.

-- 워킹 디렉터리를 원격 저장소의 마지막 commit 상태로 되돌린다.

$ git reset --hard HEAD

 


commit message 변경하기 (git commit -ament "메세지")

commit message를 잘못 적은 경우, git commit –amend 명령어를 통해 git commit message를 변경할 수 있습니다.

$ git commit --amend

 


git push 취소하기

 

이 명령을 사용하는 것은 자신의 local의 내용을 remote에 강제로 덮어쓰기를 하는 것이기 때문에 주의해야 합니다.

왜냐하면 되돌아간 commit 이후의 모든 commit 정보가 사라지기 때문에 주의를 해야 하는 것입니다.

특히, 협업 프로젝트에서는 동기화 문제가 발생할 수 있으므로 팀원과 꼭 상의하셔야 합니다.

 

원격 저장소에 push하여 저장되어 있는 경우는 아래와 같은 단계로 취소할 수 있습니다.

 

1단계 : 원하는 시점으로 워킹 디렉터리를 되돌립니다.

2단계 : 되돌려진 상태에서 다시 commit을 합니다.

3단계 : 원격 저장소에 강제로 push 합니다.

-- 1단계 : 가장 최근의 commit을 취소합니다. (기본 옵션: --mixed)
$ git reset HEAD^

-- 1단계 : 원하는 시점으로 워킹 디렉터리가 되었는지 확인합니다.
-- 1단계 : Reflog(브랜치와 HEAD가 지난 몇 달 동안에 가리켰었던 커밋) 목록 확인

$ git reflog 
또는 
$ git log -g


-- 1단계 : 원하는 시점으로 워킹 디렉터리를 되돌립니다.
$ git reset HEAD@{number} 
또는 
$ git reset [commit id]

-- 2단계 : 되돌려진 상태에서 다시 commit을 합니다.
$ git commit -m "Write commit messages"


-- 2단계 : 원격 저장소에 강제로 push 합니다.
$ git push origin [branch name] -f
또는
$ git push origin +[branch name]

-- 예를 들어 master branch를 원격 저장소(origin)에 강제로 push하겠다고 한다면
$ git push origin +master

 


추적중이지 않은 파일 삭제하기 : git clean

 

git clean 명령은 추적 중이지 않은 파일만 지우는 명령입니다.

하지만 .gitignore 에 명시하여 무시되는 파일은 지우지 않지 않습니다.

$ git clean -f         // 디렉터리를 제외한 파일들만 삭제
$ git clean -f -d      // 디렉터리까지 삭제
$ git clean -f -d -x   // 무시된 파일까지 삭제

 

-d 옵션  : 디렉터리까지 지우는 것
-x 옵션  : 무시된 파일(.DS_Store나 .gitignore에 등록한 확장자 파일들)까지 모두 지우는 것
     Ex) .o 파일 같은 빌드 파일까지도 지울 수 있다.
-n 옵션  : 가상으로 실행해보고 어떤 파일들이 지워질지 알려주는 것

728x90

create-react-app을 이용한 React 초기 개발 환경 설정

참고URL

https://xiubindev.tistory.com/92 

https://velog.io/@cjy9306/create-react-app%EC%97%90%EC%84%9C-react%EA%B0%80-%EC%8B%A4%ED%96%89%EB%90%98%EB%8A%94-%EA%B8%B0%EB%B3%B8-%EC%9B%90%EB%A6%AC-yjk56rqzlk

 

Yarn - 개선된 버전의 npm

리눅스, 혹은 macOS 에서 nvm 을 통하여 Node.js 를 설치했다면 yarn global 설치가 제대로 작동하기 위해선 다음 커맨드를  profile에 입력해줘야 합니다.

-- macOS
$ echo 'export PATH="$(yarn global bin):$PATH"' >> ~/.bash_profile

-- Linux
$ echo 'export PATH="$(yarn global bin):$PATH"' >> ~/.bashrc

 

1. create-react-app 설치

$ npm install -g create-react-app

또는 

$ yarn global add create-react-app

 

2. react app 생성

$ create-react-app first-react-app

 


 

$ npx create-react-app firstReactApp

카멜방식의 프로젝트는 생성할 수 없습니다.

단어사이에 대문자를 넣지 말고 "-" 으로 표기하여 폴더를 생성하여야 합니다.

$ npx create-react-app firstReactApp

npx: 98개의 패키지를 3.66초만에 설치했습니다.
Cannot create a project named "firstReactApp" because of npm naming restrictions:

  * name can no longer contain capital letters

Please choose a different project name.


$ cd firstReactApp
-bash: cd: firstReactApp: No such file or directory

 

$ npx create-react-app first-react-app

리엑트 프로젝트 생성 

$ npx create-react-app first-react-app
npx: 98개의 패키지를 3.102초만에 설치했습니다.

Creating a new React app in /Users/jaehonghan/dev/workspace_nodejs/first-react-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

yarn add v1.22.4
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] 🔨  Building fresh packages...
[1/4] ⡀ fsevents
[-/4] ⡀ waiting...
[-/4] ⡀ waiting...
warning Error running install script for optional dependency: "/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.4.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at \"/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python\"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jaehonghan/Library/Caches/node-gyp/14.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/jaehonghan/Library/Caches/node-gyp/14.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/jaehonghan/Library/Caches/node-gyp/14.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command \"/usr/local/Cellar/node/14.4.0/bin/node\" \"/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents
gyp ERR! node -v v14.4.0
success Saved lockfile.
success Saved 14 new dependencies.
info Direct dependencies
├─ cra-template@1.0.3
├─ react-dom@16.13.1
├─ react-scripts@3.4.1
└─ react@16.13.1
info All dependencies
├─ @babel/plugin-syntax-typescript@7.10.4
├─ @babel/plugin-transform-flow-strip-types@7.9.0
├─ @babel/plugin-transform-runtime@7.9.0
├─ @babel/plugin-transform-typescript@7.10.4
├─ @babel/preset-typescript@7.9.0
├─ babel-preset-react-app@9.1.2
├─ cra-template@1.0.3
├─ eslint-config-react-app@5.2.1
├─ react-dev-utils@10.2.1
├─ react-dom@16.13.1
├─ react-error-overlay@6.0.7
├─ react-scripts@3.4.1
├─ react@16.13.1
└─ scheduler@0.19.1
✨  Done in 11.28s.

Initialized a git repository.

Installing template dependencies using yarnpkg...
yarn add v1.22.4
[1/4] 🔍  Resolving packages...
warning @testing-library/react > @types/testing-library__react > @types/testing-library__dom@7.5.0: This is a stub types definition. testing-library__dom provides its own type definitions, so you do not need this installed.
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5".
[4/4] 🔨  Building fresh packages...
warning Error running install script for optional dependency: "/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.4.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at \"/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python\"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jaehonghan/Library/Caches/node-gyp/14.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/jaehonghan/Library/Caches/node-gyp/14.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/jaehonghan/Library/Caches/node-gyp/14.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command \"/usr/local/Cellar/node/14.4.0/bin/node\" \"/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents
gyp ERR! node -v v14.4.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok"
info This module is OPTIONAL, you can safely ignore this error
success Saved lockfile.
success Saved 21 new dependencies.
info Direct dependencies
├─ @testing-library/jest-dom@4.2.4
├─ @testing-library/react@9.5.0
├─ @testing-library/user-event@7.2.1
├─ react-dom@16.13.1
└─ react@16.13.1
info All dependencies
├─ @babel/runtime-corejs3@7.10.4
├─ @sheerun/mutationobserver-shim@0.3.3
├─ @testing-library/dom@6.16.0
├─ @testing-library/jest-dom@4.2.4
├─ @testing-library/react@9.5.0
├─ @testing-library/user-event@7.2.1
├─ @types/prop-types@15.7.3
├─ @types/react-dom@16.9.8
├─ @types/react@16.9.41
├─ @types/testing-library__dom@7.5.0
├─ @types/testing-library__react@9.1.3
├─ aria-query@4.2.2
├─ css.escape@1.5.1
├─ csstype@2.6.10
├─ dom-accessibility-api@0.3.0
├─ min-indent@1.0.1
├─ react-dom@16.13.1
├─ react@16.13.1
├─ redent@3.0.0
├─ strip-indent@3.0.0
└─ wait-for-expect@3.0.2
✨  Done in 6.09s.
Removing template package using yarnpkg...

yarn remove v1.22.4
[1/2] 🗑  Removing module cra-template...
[2/2] 🔨  Regenerating lockfile and installing missing dependencies...
warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5".
warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[-/4] ⢀ waiting...
[2/4] ⢀ fsevents
[-/4] ⢀ waiting...
warning Error running install script for optional dependency: "/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.4.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at \"/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python\"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jaehonghan/Library/Caches/node-gyp/14.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/jaehonghan/Library/Caches/node-gyp/14.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/jaehonghan/Library/Caches/node-gyp/14.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command \"/usr/local/Cellar/node/14.4.0/bin/node\" \"/usr/local/Cellar/node/14.4.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /Users/jaehonghan/dev/workspace_nodejs/first-react-app/node_modules/fsevents
gyp ERR! node -v v14.4.0
success Uninstalled packages.
✨  Done in 5.94s.

Created git commit.

Success! Created first-react-app at /Users/jaehonghan/dev/workspace_nodejs/first-react-app
Inside that directory, you can run several commands:

  yarn start
    Starts the development server.

  yarn build
    Bundles the app into static files for production.

  yarn test
    Starts the test runner.

  yarn eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd first-react-app
  yarn start

Happy hacking!

 

npm start 또는 yarn start

브라우저 창에 http://localhost:3000/로 접속하시면 에 react 초기 페이지 나타납니다.

 

$ yarn start

$ yarn start

........


Compiled successfully!

You can now view first-react-app in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://192.168.0.54:3000

Note that the development build is not optimized.
To create a production build, use yarn build.

 

http://localhost:3000/

 

+ Recent posts