RandScullard/photo-screen-saver

TypeScript errors during grunt

Closed this issue · 2 comments

Hello -- I cloned the repo from master (currently at b502383), ran npm install and grunt then got the following errors. (I am new to TypeScript so I wouldn't be surprised if this is an easy issue.)

OS: OSX 10.11.6 (dev laptop is a mac, this is going to be built to run on my Windows PC though)
node: v6.11.0
grunt-cli: v1.2.0
grunt: v1.0.1

➜  photo-screen-saver git:(master) grunt                   
Running "ts:default" (ts) task
Compiling...
### Fast Compile >>src/index.ts
### Fast Compile >>src/main.ts
Using tsc v2.4.1
node_modules/@types/node/index.d.ts(86,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'main' must be of type 'any', but here has type 'NodeModule'.
node_modules/@types/node/index.d.ts(97,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'parent' must be of type 'any', but here has type 'NodeModule'.
node_modules/@types/node/index.d.ts(98,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'children' must be of type 'any[]', but here has type 'NodeModule[]'.
node_modules/@types/node/index.d.ts(126,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'Buffer' must be of type '{ new (str: string, encoding?: string): Buffer; new (size: number): Buffer; new (array: Uint8Arra...', but here has type '{ new (str: string, encoding?: string): Buffer; new (size: number): Buffer; new (array: Uint8Arra...'.
node_modules/@types/node/index.d.ts(385,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'stdout' must be of type 'WritableStream', but here has type 'Socket'.
node_modules/@types/node/index.d.ts(386,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'stderr' must be of type 'WritableStream', but here has type 'Socket'.
node_modules/@types/node/index.d.ts(387,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'stdin' must be of type 'ReadableStream', but here has type 'Socket'.
node_modules/@types/node/index.d.ts(407,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'versions' must be of type '{ http_parser: string; node: string; v8: string; ares: string; uv: string; zlib: string; openssl:...', but here has type 'ProcessVersions'.
node_modules/@types/node/index.d.ts(438,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'platform' must be of type 'string', but here has type 'Platform'.
node_modules/@types/node/index.d.ts(640,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
node_modules/@types/node/index.d.ts(786,18): error TS2300: Duplicate identifier 'Agent'.
node_modules/@types/node/index.d.ts(844,18): error TS2300: Duplicate identifier 'Worker'.
node_modules/@types/node/index.d.ts(1002,16): error TS2403: Subsequent variable declarations must have the same type.  Variable 'workers' must be of type 'Worker[]', but here has type '{ [index: string]: Worker; }'.
node_modules/@types/node/index.d.ts(1380,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'SNICallback' must be of type '(servername: string) => any', but here has type '(servername: string, cb: (err: Error, ctx: SecureContext) => any) => any'.
node_modules/@types/node/index.d.ts(1408,16): error TS2403: Subsequent variable declarations must have the same type.  Variable 'Agent' must be of type 'new (options?: RequestOptions) => Agent', but here has type 'new (options?: AgentOptions) => Agent'.
node_modules/@types/node/index.d.ts(1576,10): error TS2300: Duplicate identifier 'Completer'.
node_modules/@types/node/index.d.ts(1579,17): error TS2300: Duplicate identifier 'CompleterResult'.
node_modules/@types/node/index.d.ts(1584,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'completer' must be of type 'Completer', but here has type 'Completer | AsyncCompleter'.
node_modules/@types/node/index.d.ts(3025,16): error TS2403: Subsequent variable declarations must have the same type.  Variable 'StringDecoder' must be of type 'new (encoding: string) => NodeStringDecoder', but here has type 'new (encoding?: string) => NodeStringDecoder'.
node_modules/@types/node/index.d.ts(3285,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'pfx' must be of type 'any', but here has type 'string | Buffer[]'.
node_modules/@types/node/index.d.ts(3286,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'key' must be of type 'any', but here has type 'string | any[] | string[] | Buffer'.
node_modules/@types/node/index.d.ts(3288,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'cert' must be of type 'any', but here has type 'string | string[] | Buffer | Buffer[]'.
node_modules/@types/node/index.d.ts(3289,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'ca' must be of type 'any', but here has type 'string | string[] | Buffer | Buffer[]'.
node_modules/@types/node/index.d.ts(3290,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'crl' must be of type 'any', but here has type 'string | string[]'.
node_modules/@types/node/index.d.ts(3292,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'honorCipherOrder' must be of type 'any', but here has type 'boolean'.
node_modules/@types/node/index.d.ts(3295,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'NPNProtocols' must be of type 'any', but here has type 'string[] | Buffer'.
node_modules/@types/node/index.d.ts(3296,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'SNICallback' must be of type '(servername: string) => any', but here has type '(servername: string, cb: (err: Error, ctx: SecureContext) => any) => any'.
node_modules/@types/node/index.d.ts(3311,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'pfx' must be of type 'any', but here has type 'string | Buffer'.
node_modules/@types/node/index.d.ts(3312,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'key' must be of type 'any', but here has type 'string | string[] | Buffer | Buffer[]'.
node_modules/@types/node/index.d.ts(3314,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'cert' must be of type 'any', but here has type 'string | string[] | Buffer | Buffer[]'.
node_modules/@types/node/index.d.ts(3315,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'ca' must be of type 'any', but here has type 'string | Buffer | (string | Buffer)[]'.
node_modules/@types/node/index.d.ts(3317,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'NPNProtocols' must be of type 'any', but here has type '(string | Buffer)[]'.
node_modules/@types/node/index.d.ts(3413,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'pfx' must be of type 'any', but here has type 'string | Buffer'.
node_modules/@types/node/index.d.ts(3414,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'key' must be of type 'any', but here has type 'string | Buffer'.
node_modules/@types/node/index.d.ts(3416,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'cert' must be of type 'any', but here has type 'string | Buffer'.
node_modules/@types/node/index.d.ts(3417,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'ca' must be of type 'any', but here has type 'string | Buffer'.
node_modules/@types/node/index.d.ts(3418,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'crl' must be of type 'any', but here has type 'string | string[]'.
node_modules/@types/node/index.d.ts(3453,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'ca' must be of type 'any', but here has type 'string | string[]'.
node_modules/@types/node/index.d.ts(3454,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'crl' must be of type 'any', but here has type 'string | string[]'.
node_modules/@types/node/index.d.ts(3806,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
node_modules/@types/node/index.d.ts(3880,5): error TS2300: Duplicate identifier 'export='.
node_modules/@types/node/index.d.ts(3902,18): error TS2300: Duplicate identifier 'Domain'.
typings/github-electron/github-electron.d.ts(95,8): error TS2420: Class 'Screen' incorrectly implements interface 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => Screen' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'Screen' is not assignable to type 'EventEmitter'.
        Property 'prependListener' is missing in type 'Screen'.
typings/github-electron/github-electron.d.ts(132,8): error TS2420: Class 'BrowserWindow' incorrectly implements interface 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => WebContents' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'WebContents' is not assignable to type 'EventEmitter'.
        Property 'prependListener' is missing in type 'WebContents'.
typings/github-electron/github-electron.d.ts(549,8): error TS2420: Class 'WebContents' incorrectly implements interface 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => WebContents' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'WebContents' is not assignable to type 'EventEmitter'.
typings/github-electron/github-electron.d.ts(963,8): error TS2420: Class 'App' incorrectly implements interface 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => App' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'App' is not assignable to type 'EventEmitter'.
        Property 'prependListener' is missing in type 'App'.
typings/github-electron/github-electron.d.ts(1170,8): error TS2420: Class 'AutoUpdater' incorrectly implements interface 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => AutoUpdater' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'AutoUpdater' is not assignable to type 'EventEmitter'.
        Property 'prependListener' is missing in type 'AutoUpdater'.
typings/github-electron/github-electron.d.ts(1290,8): error TS2420: Class 'Tray' incorrectly implements interface 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => Tray' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'Tray' is not assignable to type 'EventEmitter'.
        Property 'prependListener' is missing in type 'Tray'.
typings/github-electron/github-electron.d.ts(1482,15): error TS2420: Class 'IpcRenderer' incorrectly implements interface 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => IpcRenderer' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'IpcRenderer' is not assignable to type 'EventEmitter'.
        Property 'prependListener' is missing in type 'IpcRenderer'.
typings/github-electron/github-electron.d.ts(1514,8): error TS2420: Class 'IPCMain' incorrectly implements interface 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => IPCMain' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'IPCMain' is not assignable to type 'EventEmitter'.
        Property 'prependListener' is missing in type 'IPCMain'.
typings/node/node.d.ts(434,18): error TS2420: Class 'EventEmitter' incorrectly implements interface 'NodeJS.EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => EventEmitter' is not assignable to type '{ (event: string, listener: Function): EventEmitter; (event: string | symbol, listener: Function)...'.
      Type 'EventEmitter' is not assignable to type 'NodeJS.EventEmitter'.
        Property 'prependListener' is missing in type 'EventEmitter'.
typings/node/node.d.ts(472,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'addListener' of types 'EventEmitter' and 'Server' are not identical.
typings/node/node.d.ts(472,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'emit' of types 'EventEmitter' and 'Server' are not identical.
typings/node/node.d.ts(472,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'on' of types 'EventEmitter' and 'Server' are not identical.
typings/node/node.d.ts(472,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'once' of types 'EventEmitter' and 'Server' are not identical.
typings/node/node.d.ts(472,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'prependListener' of types 'EventEmitter' and 'Server' are not identical.
typings/node/node.d.ts(472,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'prependOnceListener' of types 'EventEmitter' and 'Server' are not identical.
typings/node/node.d.ts(472,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'.
  Named property 'removeListener' of types 'EventEmitter' and 'Server' are not identical.
typings/node/node.d.ts(487,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'addListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(487,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'emit' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(487,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'on' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(487,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'once' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(487,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'prependListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(487,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'prependOnceListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(487,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'removeListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(515,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'addListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(515,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'emit' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(515,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'on' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(515,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'once' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(515,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'prependListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(515,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'prependOnceListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(515,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'.
  Named property 'removeListener' of types 'EventEmitter' and 'Writable' are not identical.
typings/node/node.d.ts(536,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'addListener' of types 'EventEmitter' and 'Readable' are not identical.
typings/node/node.d.ts(536,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'emit' of types 'EventEmitter' and 'Readable' are not identical.
typings/node/node.d.ts(536,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'on' of types 'EventEmitter' and 'Readable' are not identical.
typings/node/node.d.ts(536,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'once' of types 'EventEmitter' and 'Readable' are not identical.
typings/node/node.d.ts(536,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'prependListener' of types 'EventEmitter' and 'Readable' are not identical.
typings/node/node.d.ts(536,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'prependOnceListener' of types 'EventEmitter' and 'Readable' are not identical.
typings/node/node.d.ts(536,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'.
  Named property 'removeListener' of types 'EventEmitter' and 'Readable' are not identical.
typings/node/node.d.ts(586,18): error TS2300: Duplicate identifier 'Agent'.
typings/node/node.d.ts(625,18): error TS2300: Duplicate identifier 'Worker'.
typings/node/node.d.ts(868,22): error TS2300: Duplicate identifier 'Completer'.
typings/node/node.d.ts(873,22): error TS2300: Duplicate identifier 'CompleterResult'.
typings/node/node.d.ts(1092,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'Socket' and 'EventEmitter'.
  Named property 'removeListener' of types 'Socket' and 'EventEmitter' are not identical.
typings/node/node.d.ts(1620,22): error TS2430: Interface 'Server' incorrectly extends interface 'Server'.
typings/node/node.d.ts(1620,22): error TS2430: Interface 'Server' incorrectly extends interface 'Server'.
  Types of property 'listen' are incompatible.
    Type '{ (port: number, host?: string, backlog?: number, listeningListener?: Function): Server; (path: s...' is not assignable to type '{ (port: number, host?: string, backlog?: number, listeningListener?: Function): Server; (path: s...'. Two different types with this name exist, but they are unrelated.
      Type 'Server' is not assignable to type 'Server'. Two different types with this name exist, but they are unrelated.
        Types of property 'listen' are incompatible.
          Type '{ (port: number, host?: string, backlog?: number, listeningListener?: Function): Server; (path: s...' is not assignable to type '{ (port: number, host?: string, backlog?: number, listeningListener?: Function): Server; (path: s...'. Two different types with this name exist, but they are unrelated.
            Types of parameters 'host' and 'backlog' are incompatible.
              Type 'number' is not assignable to type 'string'.
typings/node/node.d.ts(1774,18): error TS2420: Class 'Readable' incorrectly implements interface 'ReadableStream'.
  Types of property 'setEncoding' are incompatible.
    Type '(encoding: string) => void' is not assignable to type '{ (encoding: string): void; (encoding: string): this; }'.
      Type 'void' is not assignable to type 'this'.
typings/node/node.d.ts(1811,18): error TS2420: Class 'Duplex' incorrectly implements interface 'ReadWriteStream'.
  Types of property 'setEncoding' are incompatible.
    Type '(encoding: string) => void' is not assignable to type '{ (encoding: string): void; (encoding: string): this; }'.
      Type 'void' is not assignable to type 'this'.
typings/node/node.d.ts(1825,18): error TS2420: Class 'Transform' incorrectly implements interface 'ReadWriteStream'.
  Types of property 'setEncoding' are incompatible.
    Type '(encoding: string) => void' is not assignable to type '{ (encoding: string): void; (encoding: string): this; }'.
      Type 'void' is not assignable to type 'this'.
typings/node/node.d.ts(1916,5): error TS2300: Duplicate identifier 'export='.
typings/node/node.d.ts(1938,18): error TS2300: Duplicate identifier 'Domain'.
typings/node/node.d.ts(1938,18): error TS2415: Class 'Domain' incorrectly extends base class 'EventEmitter'.
  Types of property 'addListener' are incompatible.
    Type '(event: string, listener: Function) => Domain' is not assignable to type '(event: string | symbol, listener: Function) => this'.
      Type 'Domain' is not assignable to type 'this'.

>> 92 non-emit-preventing type warnings  
>> Error: tsc return code: 2
Warning: Task "ts:default" failed. Use --force to continue.

Aborted due to warnings.
➜  photo-screen-saver git:(master)

Thanks for letting me know! I just updated to the latest versions of all dependencies and fixed my code to match. Grab my new code, clean out your node_modules directory and re-run npm install. Then you should be able to run grunt without errors. Let me know if that works and I'll close this issue.

That appears to be working now - thanks!