An error occurs when npm run build.
Electron: 7.1.2
The typescript is ^2.5.1
The target is ES2017.

Szczegóły błędu są jak poniżej.

Kiedy zrobiłem w tych warunkach

Electron: 6.0.0
The typescript is ^2.5.1
The target is ES2017.

Poniższe błędy nie wystąpiły. Ale zmieniam wersję Electron na 7.1.2, te błędy występują.

Czy możesz mi powiedzieć, dlaczego się nie buduje?


> tsc
node_modules/electron/electron.d.ts:171:62 - error TS2304: Cannot find name 'unknown
171 userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:180:62 - error TS2304: Cannot find name 'unknown
180 userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:189:62 - error TS2304: Cannot find name 'unknown
189 userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:198:62 - error TS2304: Cannot find name 'unknown
198 userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:309:57 - error TS2304: Cannot find name 'unknown
309                                               userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:318:57 - error TS2304: Cannot find name 'unknown
318                                               userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:327:57 - error TS2304: Cannot find name 'unknown
327                                               userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:336:57 - error TS2304: Cannot find name 'unknown
336                                               userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:507:47 - error TS2304: Cannot find name 'unknown
507     on(event: 'ready', listener: (launchInfo: unknown) => void): this;
 
node_modules/electron/electron.d.ts:508:49 - error TS2304: Cannot find name 'unknown
508     once(event: 'ready', listener: (launchInfo: unknown) => void): this;
   
node_modules/electron/electron.d.ts:509:56 - error TS2304: Cannot find name 'unknown
509     addListener(event: 'ready', listener: (launchInfo: unknown) => void): this;
          
node_modules/electron/electron.d.ts:510:59 - error TS2304: Cannot find name 'unknown
510     removeListener(event: 'ready', listener: (launchInfo: unknown) => void): this;
             
node_modules/electron/electron.d.ts:722:61 - error TS2304: Cannot find name 'unknown
722 userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:731:61 - error TS2304: Cannot find name 'unknown
731 userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:740:61 - error TS2304: Cannot find name 'unknown
740 userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:749:61 - error TS2304: Cannot find name 'unknown
749 userInfo: unknown) => void): this;
node_modules/electron/electron.d.ts:935:57 - error TS2304: Cannot find name 'unknown
935     getGPUInfo(infoType: 'basic' | 'complete'): Promise;
           
node_modules/electron/electron.d.ts:3637:45 - error TS2304: Cannot find name 'unknown
3637                                     params: unknown) => void): this;
node_modules/electron/electron.d.ts:3647:45 - error TS2304: Cannot find name 'unknown
3647                                     params: unknown) => void): this;
node_modules/electron/electron.d.ts:3657:45 - error TS2304: Cannot find name 'unknown
3657                                     params: unknown) => void): this;
node_modules/electron/electron.d.ts:3667:45 - error TS2304: Cannot find name 'unknown
3667                                     params: unknown) => void): this;
node_modules/electron/electron.d.ts:6928:98 - error TS2304: Cannot find name 'unknown
6928     subscribeLocalNotification(event: string, callback: (event: string, userInfo: Record, object: string) => void): number;
     
   
node_modules/electron/electron.d.ts:6951:93 - error TS2304: Cannot find name 'unknown
6951     subscribeNotification(event: string, callback: (event: string, userInfo: Record, object: string) => void): number;
                                
node_modules/electron/electron.d.ts:6959:102 - error TS2304: Cannot find name 'unknown
6959     subscribeWorkspaceNotification(event: string, callback: (event: string, userInfo: Record, object: string) => void): void;
     
2
Grape111 20 grudzień 2019, 08:03

1 odpowiedź

Zaktualizuj swój maszynopis do wersji 3 lub nowszej.

W Twojej aplikacji

npm install typescript@latest --save

Lub zainstaluj go jako globalny,

npm install -g typescript@latest
0
Tshaby 2 styczeń 2020, 23:49