Typescript: lib/lib.d.ts error Cannot find name 'object'.

Created on 14 Mar 2017  ·  3Comments  ·  Source: microsoft/TypeScript

TypeScript Version: 2.2.1

using gulp typescript with latest version 2.2.1 of typescript throws errors:

typescript/lib/lib.d.ts(163,15): error TS2304: Cannot find name 'object'.
typescript/lib/lib.d.ts(170,15): error TS2304: Cannot find name 'object'.

Expected behavior:
Compile without errors

Actual behavior:

typescript/lib/lib.d.ts(163,15): error TS2304: Cannot find name 'object'.
typescript/lib/lib.d.ts(170,15): error TS2304: Cannot find name 'object'.

-> renaming the lines to the following (just changed object to Object) solves the compile error

create(o: Object | null): any;

    /**
      * Creates an object that has the specified prototype, and that optionally contains specified properties.
      * @param o Object to use as a prototype. May be null
      * @param properties JavaScript object that contains one or more property descriptors.
      */
    create(o: Object | null, properties: PropertyDescriptorMap): any;
Question

Most helpful comment

object is a keyword in TS2.2. Is it possible you're compiling with a different version than the version you get lib from?

All 3 comments

object is a keyword in TS2.2. Is it possible you're compiling with a different version than the version you get lib from?

I found some errors in my package,json (double entries in dev and "normal" dependencies) -> fixed it and re-installed all packages -> seems to work now.
Thanks for the hint

👍 Thanks @andy-ms

Was this page helpful?
0 / 5 - 0 ratings