npx create-react-app "프로젝트 이름" —template typescript
https://codingdiary99.tistory.com/entry/CRA로-TypeScript-React-프로젝트-생성하기
이 사이트를 참고해서 위와 같이 확장자를 다 ts 또는 tsx로 변경 후에 아래 명령어를 실행해 typescript를 적용하기 위해 필요한 라이브러리 설치를 진행했다.
$ npm install --save typescript @types/node @types/react @types/react-dom @types/jest
아래와 같은 오류가 떴다 ..
up to date, audited 1469 packages in 2s
226 packages are looking for funding
run `npm fund` for details
10 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
구글링해보니 만만치 않은 에러라 node를 재설치하는 걸로 결정 ..!!
brew uninstall node
node -v
npm -v
# node와 npm이 있는지 확인차 버전확인 명령어 입력
똑같이 저 오류가 뜬다 ,,
이는 사용하는 npm 모듈의 취약점을 검사해주는 Node Security Platform
(보통nsp
명령어로 사용한다)를 npm, Inc가 인수하면서 NSP의 데이터베이스를 이용해서 취약점을 점검해 주는 기능을 추가한 것이다
audit이 뭔지 궁금해서 찾아봤는데, 저렇다고 한다.
그래서 이 기능을 사용하지 않기로 결정, 아래 명령어를 입력했다
npm set audit false
그랬더니 아래처럼 오류는 줄긴 줄었는데 해결 실패
226 packages are looking for funding
run `npm fund` for detail
npm install --no-fund --save typescript @types/node @types/react @types/react-dom @types/jest
이렇게 —no-fund
를 npm install
명령어와 함께 입력하니 해결 ^^