npx로 typescript 프로젝트를 만들었을때 vscode에서 위와 같은 에러가 발생했다.

구글링 중에 tsconfig.json의 내용을 바꾸라는 내용이 다수였는데 이 방법 보다 더 정확해 보이는 해결책을 찾았다.

stackoverflow.com/questions/50432556/cannot-use-jsx-unless-the-jsx-flag-is-provided

 

Cannot use JSX unless the '--jsx' flag is provided

I have looked around a bit for a solution to this problem. All of them suggest adding "jsx": "react" to your tsconfig.json file. Which I have done. Another one was to add "include: []", which I hav...

stackoverflow.com

cmd + shift + p -> select typescript version -> Use Workspace Version 4.x.x 로 변경하니 error가 사라졌다.

이걸 설정하기 전 typescript버전은 3.x.x였는데 4.x.x로 변경했더니 문제가 사라졌다.

'Programming > JavaScript' 카테고리의 다른 글

event.stopPropagation(), event.preventDefault () 이해하기  (0) 2014.10.20
[JAVASCRIPT] replace  (0) 2013.05.08
#9 11.82 npm ERR! code ENOENT
#9 11.83 npm ERR! path git
#9 11.83 npm ERR! errno -2
#9 11.83 npm ERR! enoent Error while executing:
#9 11.83 npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
#9 11.83 npm ERR! enoent
#9 11.83 npm ERR! enoent
#9 11.83 npm ERR! enoent This is related to npm not being able to find a file.
#9 11.85
#9 11.85 npm ERR! A complete log of this run can be found in:
#9 11.85 npm ERR!     /root/.npm/_logs/2020-11-10T14_49_13_350Z-debug.log

이거로 한참을 헤매었다.... 아오~

 

FROM node:14.15-alpine
WORKDIR /app
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

dockerfile이다... 별 문제 없어 보인다. 그러니 저런 에러가 나오면 멘붕이지...

alpine 이미지의 특성인지는 모르겠지만 "git@github.com/eligrey/FileSaver.js.git" 이 repository를 땡겨오는데 문제가 생겼고 path git 이라는 문구도 보인다... 설마설마... alpine에 git이 없나??? (npm install인데 git에서도 땡겨오는지는 몰랐음....)

 

RUN git --verion을 추가하기에 이르렀다. 예상대로 git 명령어 없음.

 

RUN npm install 전에 아래 추가하여 git 설치 했더니 문제 없이 docker image가 build되었다.

 

RUN apk update && apk upgrade && apk add --no-cache bash git openssh

+ Recent posts