Definitelytyped: 잘λͺ»λœ 'μ°Έμ‘°' μ§€μ‹œλ¬Έ ꡬ문

에 λ§Œλ“  2016λ…„ 07μ›” 13일  Β·  26μ½”λ©˜νŠΈ  Β·  좜처: DefinitelyTyped/DefinitelyTyped

commander μ •μ˜λ₯Ό λ³€κ²½ν•˜λŠ” types-2.0 뢄기에 PR을 λ§Œλ“€κ³  μ‹ΆμŠ΅λ‹ˆλ‹€.

npm test λ₯Ό μ‹€ν–‰ν•  λ•Œ 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

commander/index.d.ts(6,1): error TS1084: Invalid 'reference' directive syntax.
/// <reference types="node" />

μ–΄λ–»κ²Œ κ³ μΉ  수 μžˆλ‚˜μš”?

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

λ™μΌν•œ μ˜ˆμ™Έκ°€ λ°œμƒν•©λ‹ˆλ‹€.

node_modules/@types/pdfjs-dist/index.d.ts(7,1) 였λ₯˜: 였λ₯˜ TS1084: 잘λͺ»λœ 'μ°Έμ‘°' μ§€μ‹œλ¬Έ

톡사둠
μœ ν˜• 슀크립트 버전:
"typescript": "2.8.3"

typescript 버전을 λ‹€μŒμœΌλ‘œ μ—…λ°μ΄νŠΈν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν–ˆμŠ΅λ‹ˆλ‹€.

"typescript": "3.5.1"

λͺ¨λ“  26 λŒ“κΈ€

[email protected] 이상을 μ‚¬μš©ν•˜μ—¬ λΉŒλ“œν•˜μ„Έμš”.

λ‚˜λ₯Ό μœ„ν•΄ 그것을 ν•΄κ²°ν–ˆλ‹€.
@sanex3339 λ¬Έμ œκ°€ ν•΄κ²°λœ 경우 이 문제λ₯Ό μ’…λ£Œν•  수 μžˆμŠ΅λ‹ˆκΉŒ?

μ €λŠ” typescrpit 버전 2.7을 μ‚¬μš©ν•˜κ³  있으며 λ‹€μŒμ— λŒ€ν•΄ μ—¬μ „νžˆ 이 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.

/// <reference types="angular" />

ERROR in [default] xxx/node_modules/metismenu/types/metismenu.d.ts:6:0
Invalid 'reference' directive syntax.

ERROR in [default] xxx/metismenu/types/metismenu.d.ts:24:55
Cannot find name 'JQueryEventObject'.

ERROR in [default] xxx/src/vendor.browser.ts:4:7
Exported external package typings file 'xxx/node_modules/metismenu/types/metismenu.d.ts' is not a module. Please contact the package author to update the package definition.

이 λ¬Έμ œλ„ λ§Œλ‚¬μŠ΅λ‹ˆλ‹€.
그리고 λ‚΄ typescrpit은 버전 2.9.1μž…λ‹ˆλ‹€.

λ™μΌν•œ μ˜ˆμ™Έκ°€ λ°œμƒν•©λ‹ˆλ‹€.

node_modules/@types/pdfjs-dist/index.d.ts(7,1) 였λ₯˜: 였λ₯˜ TS1084: 잘λͺ»λœ 'μ°Έμ‘°' μ§€μ‹œλ¬Έ

톡사둠
μœ ν˜• 슀크립트 버전:
"typescript": "2.8.3"

typescript 버전을 λ‹€μŒμœΌλ‘œ μ—…λ°μ΄νŠΈν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν–ˆμŠ΅λ‹ˆλ‹€.

"typescript": "3.5.1"

일

λ™μΌν•œ μ˜ˆμ™Έκ°€ λ°œμƒν•©λ‹ˆλ‹€.

node_modules/@types/pdfjs-dist/index.d.ts(7,1) 였λ₯˜: 였λ₯˜ TS1084: 잘λͺ»λœ 'μ°Έμ‘°' μ§€μ‹œλ¬Έ

톡사둠
μœ ν˜• 슀크립트 버전:
"typescript": "2.8.3"

이 문제λ₯Ό ν•΄κ²°ν•˜λŠ” 데 도움을 μ£Όμ‹œλ©΄ κ°μ‚¬ν•˜κ² μŠ΅λ‹ˆλ‹€.

같은 였λ₯˜λ„... λ„μ™€μ£Όμ„Έμš”...

μ΄κ²ƒμœΌλ‘œ λ‚΄ μ‹œκ°„μ„ λ¨Ήκ³ 
node_modules/@types/pdfjs-dist/index.d.ts(7,1) 였λ₯˜: 였λ₯˜ TS1084: 'μ°Έμ‘°' μ§€μ‹œλ¬Έ ꡬ문이 잘λͺ»λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
ν˜„μž¬ νƒ€μ΄ν”„μŠ€ν¬λ¦½νŠΈ 버전: 2.4.2

typescript v 3.1.6으둜 μ—…κ·Έλ ˆμ΄λ“œν•œ ν›„
둜컬 "typescript" νŒ¨ν‚€μ§€λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€. "@ngtools/webpack" νŒ¨ν‚€μ§€λ₯Ό μ„€μΉ˜ν•˜λ €λ©΄ 둜컬 "typescript@^2.0.2" νŒ¨ν‚€μ§€κ°€ ν•„μš”ν•©λ‹ˆλ‹€.였λ₯˜

* λ‹Ήμ‹ μ˜ 도움이 κ°€μž₯ μ†Œμ€‘ν•©λ‹ˆλ‹€.

여기에 같은 였λ₯˜κ°€ μžˆμŠ΅λ‹ˆλ‹€. :(아직 아무것도?
였λ₯˜ Typescript 였λ₯˜
잘λͺ»λœ 'μ°Έμ‘°' μ§€μ‹œλ¬Έ κ΅¬λ¬Έμž…λ‹ˆλ‹€.
node_modules/@types/pdfjs-dist/index.d.ts

νƒ€μ΄ν”„μŠ€ν¬λ¦½νŠΈ 였λ₯˜
'CustomEvent' μœ ν˜•μ΄ 일반이 μ•„λ‹™λ‹ˆλ‹€.
node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts

ν˜„μž¬ νƒ€μ΄ν”„μŠ€ν¬λ¦½νŠΈ 버전: 2.6.2

node_modules/@types/pdfjs-dist/index.d.ts(7,1): 였λ₯˜ TS1084: 잘λͺ»λœ 'μ°Έμ‘°' μ§€μ‹œλ¬Έ ꡬ문

λ‹€μ–‘ν•œ typescript 버전을 μ‹œλ„ν–ˆμ§€λ§Œ ..... ν—ˆμ‚¬μž…λ‹ˆλ‹€. λ„μ™€μ£Όμ„Έμš”

μ–΄λ–»κ²Œ κ³ μΉ  수 μžˆμŠ΅λ‹ˆκΉŒ?
///

ν•΄κ²°μ±…
node_modules\@types\pdfjs-dist\index.d.ts

7ν–‰
3 ///을 2둜 λ³€κ²½ //

λ™μΌν•œ 문제 및 버전이 μžˆμŠ΅λ‹ˆλ‹€.
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/10097#issuecomment -499862328

https://github.com/DefinitelyTyped/DefinitelyTyped/issues/10097#issuecomment -499826179와 λ™μΌν•œ λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

이에 λŒ€ν•œ μž„μ‹œ ν•΄κ²°μ±…
node_modules/@types/pdfjs-dist/index.d.ts 파일의 7번 라인에 μžˆλŠ” /// / ν•˜λ‚˜λ₯Ό μ œκ±°ν•©λ‹ˆλ‹€.

이 λ¬Έμ œκ°€ μ΅œλŒ€ν•œ 빨리 ν•΄κ²°λ˜κΈ°λ₯Ό λ°”λžλ‹ˆλ‹€!!!

#10097(λŒ“κΈ€) κ³Ό 같은 λ¬Έμ œκ°€ μžˆμ—ˆμŠ΅λ‹ˆλ‹€.

이에 λŒ€ν•œ μž„μ‹œ ν•΄κ²°μ±…
node_modules/@types/pdfjs-dist/index.d.ts 파일의 7번 라인에 μžˆλŠ” /// / ν•˜λ‚˜λ₯Ό μ œκ±°ν•©λ‹ˆλ‹€.

이 λ¬Έμ œκ°€ μ΅œλŒ€ν•œ 빨리 ν•΄κ²°λ˜κΈ°λ₯Ό λ°”λžλ‹ˆλ‹€!!!

λ‚˜λŠ” 그것이 νš¨κ³Όκ°€ μžˆμŒμ„ ν™•μΈν•©λ‹ˆλ‹€. 감사 ν•΄μš”

λ‹€λ₯Έ 해결책은 "typescript": "3.5.1" 버전을 μ‚¬μš©ν•˜κ³  other :(

μˆ˜μ •μ€ λΈ”λ‘μ˜ package.json νŒŒμΌμ—μ„œ μˆ˜ν–‰ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. "devDependencies": {}

삼쀑 μŠ¬λž˜μ‹œμ—μ„œ μŠ¬λž˜μ‹œλ₯Ό μ œκ±°ν•˜λ©΄ 정상적인 주석이 λ©λ‹ˆλ‹€. 이 경우 μ œκ±°ν•˜λ©΄ λ©λ‹ˆλ‹€. μ—¬μ „νžˆ μ»΄νŒŒμΌν•  수 μžˆλ‹€λ©΄ μ•„λ§ˆλ„ 더 이상 ν•„μš”ν•˜μ§€ μ•Šμ•˜μ„ κ²ƒμž…λ‹ˆλ‹€.

#10097(λŒ“κΈ€) κ³Ό 같은 λ¬Έμ œκ°€ μžˆμ—ˆμŠ΅λ‹ˆλ‹€.
이에 λŒ€ν•œ μž„μ‹œ ν•΄κ²°μ±…
node_modules/@types/pdfjs-dist/index.d.ts 파일의 7번 라인에 μžˆλŠ” /// / ν•˜λ‚˜λ₯Ό μ œκ±°ν•©λ‹ˆλ‹€.
이 λ¬Έμ œκ°€ μ΅œλŒ€ν•œ 빨리 ν•΄κ²°λ˜κΈ°λ₯Ό λ°”λžλ‹ˆλ‹€!!!

λ‚˜λŠ” 그것이 νš¨κ³Όκ°€ μžˆμŒμ„ ν™•μΈν•©λ‹ˆλ‹€. 감사 ν•΄μš”

λ‹€λ₯Έ 해결책은 "typescript": "3.5.1" 버전을 μ‚¬μš©ν•˜κ³  other :(

μˆ˜μ •μ€ λΈ”λ‘μ˜ package.json νŒŒμΌμ—μ„œ μˆ˜ν–‰ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. "devDependencies": {}

"typescript": "3.5.1"을 μ‚¬μš©ν•˜μ—¬ 해결을 ν™•μΈν•©λ‹ˆλ‹€.

"npm i [email protected] " λͺ…λ Ή μ‚¬μš©

"npm i [email protected] " λͺ…λ Ή μ‚¬μš©

특히 버전 μ œμ–΄λ₯Ό μ‚¬μš©ν•˜λŠ” 경우 package.json을 λ³€κ²½ν•  ν•„μš”κ°€ μ—†λŠ” μ΅œμƒμ˜ μ†”λ£¨μ…˜μž…λ‹ˆλ‹€.

λ‚˜λŠ” 같은 λ¬Έμ œκ°€ μžˆμ—ˆκ³  typescript 3.5.1둜 μ—…λ°μ΄νŠΈν•˜λŠ” 것은 μ˜΅μ…˜μ΄ μ•„λ‹ˆμ—ˆμŠ΅λ‹ˆλ‹€.
λ‚΄κ°€ ν•œ 것은 λ‚΄ typescript 버전과 μΌμΉ˜ν•˜λŠ” pdfjs-dist용 버전을 μ‚¬μš©ν•˜μ—¬ ng2-pdf-viewer용으둜 μΌμΉ˜ν•˜λŠ” 버전을 μ‚¬μš©ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€.
λ‚΄κ°€ μ‚¬μš©ν•œ λ‹€λ₯Έ 버전은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.
νƒ€μ΄ν”„μŠ€ν¬λ¦½νŠΈ @2.7.2
ng2-pdf λ·°μ–΄ @5.2.4
@types/pdfjs-dist @0.1.2

7번 μ€„μ—μ„œ ///μ—μ„œ ν•˜λ‚˜μ˜ μ œκ±°κ°€ μž‘λ™ν•©λ‹ˆλ‹€.
λ‚΄ tsλŠ” 2.7.2μ˜€μŠ΅λ‹ˆλ‹€

μ–˜λ“€ μ•„!

이것은 λ‚˜λ₯Ό μœ„ν•΄ μΌν–ˆμŠ΅λ‹ˆλ‹€.

npm i [email protected] --save
npm i [email protected] --save

이것은 λ‚΄ 말에 κΈ°μΈν•©λ‹ˆλ‹€.

πŸ’¬-> npm ls typescript
β”œβ”€β”¬ @ionic/[email protected]
β”‚ └─┬ @angular-devkit/[email protected]
β”‚   └── [email protected] 

TypescriptλŠ” ν‘œμ‹œλœ λŒ€λ‘œ μ’…μ†μ„±μœΌλ‘œ 인해 μ΅œλŒ€ 2.6.2둜 κ°•μ œ μ‹€ν–‰λ©λ‹ˆλ‹€.

npm ls typescript λͺ¨ν—˜μ— 따라 λ‹€λ₯Έ λ¬Έμ œκ°€ μžˆμ„ 수 μžˆμŠ΅λ‹ˆλ‹€.

ionic serve λ˜λŠ” 이와 μœ μ‚¬ν•œ 것을 λ‹€μ‹œ μ‹œμž‘ν•˜λŠ” 것을 μžŠμ§€ λ§ˆμ‹­μ‹œμ˜€.

μ–˜λ“€ μ•„!

이것은 λ‚˜λ₯Ό μœ„ν•΄ μΌν–ˆμŠ΅λ‹ˆλ‹€.

npm i [email protected] --save
npm i [email protected] --save

이것은 λ‚΄ 말에 κΈ°μΈν•©λ‹ˆλ‹€.

πŸ’¬-> npm ls typescript
β”œβ”€β”¬ @ionic/[email protected]
β”‚ └─┬ @angular-devkit/[email protected]
β”‚   └── [email protected] 

TypescriptλŠ” ν‘œμ‹œλœ λŒ€λ‘œ μ’…μ†μ„±μœΌλ‘œ 인해 μ΅œλŒ€ 2.6.2둜 κ°•μ œ μ‹€ν–‰λ©λ‹ˆλ‹€.

npm ls typescript λͺ¨ν—˜μ— 따라 λ‹€λ₯Έ λ¬Έμ œκ°€ μžˆμ„ 수 μžˆμŠ΅λ‹ˆλ‹€.

ionic serve λ˜λŠ” 이와 μœ μ‚¬ν•œ 것을 λ‹€μ‹œ μ‹œμž‘ν•˜λŠ” 것을 μžŠμ§€ λ§ˆμ‹­μ‹œμ˜€.

그것은 λ‚˜λ₯Ό μœ„ν•΄ μΌν–ˆμŠ΅λ‹ˆλ‹€. 감사 ν•΄μš”!!!

index.d.ts νŒŒμΌμ—μ„œ 아무 μ€„μ΄λ‚˜ μˆ˜μ •ν•˜κ³  λ³€κ²½ 사항을 μ €μž₯ν•˜κ³  μ»΄νŒŒμΌν•©λ‹ˆλ‹€. λ³€κ²½ 사항은 κ³΅λ°±μ΄μ—ˆμŠ΅λ‹ˆλ‹€.

"npm i [email protected] " λͺ…λ Ή μ‚¬μš©

λ‚˜λ₯Ό μœ„ν•΄ μΌν–ˆλ‹€

"npm i [email protected] " μ‚¬μš© |
λ‚˜λ₯Ό μœ„ν•΄ μΌν–ˆλ‹€

"nest-schedule/0.6.4" νŒ¨ν‚€μ§€λ₯Ό λΉŒλ“œν•˜λŠ” λ™μ•ˆ λ™μΌν•œ λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.
npm install [email protected] 둜 typescript v3λ₯Ό μ„€μΉ˜ν•˜λ©΄ ν•΄κ²°λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

도움을 μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€.

node_modules/@types/pdfjs-dist/index.d.ts 파일의 7번 라인에 μžˆλŠ” /// / ν•˜λ‚˜λ₯Ό μ œκ±°ν•©λ‹ˆλ‹€.

μΆ”κ°€ '/'λ₯Ό μ œκ±°ν•˜λ©΄ "잘λͺ»λœ 'μ°Έμ‘°' μ§€μ‹œλ¬Έ κ΅¬λ¬Έμž…λ‹ˆλ‹€. webpack: μ»΄νŒŒμΌν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€." 였λ₯˜λ₯Ό μ œκ±°ν•˜λŠ” 데 도움이 λ©λ‹ˆλ‹€.
κ°μ‚¬ν•©λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰