Definitelytyped: [@types/node]: Cannot find name 'Symbol'.

Created on 29 Apr 2018  路  5Comments  路  Source: DefinitelyTyped/DefinitelyTyped

//cc @rbuckton @DanielRosenwasser @andy-ms as #25269 may have caused this, but I'm not sure.

Since a couple of days, I am unable to build our typescript project due to the follwing error:

/node_modules/@types/node/index.d.ts(6151,64): error TS2304: Cannot find name 'Symbol'.

We get the Node types as a transient dependency, so we are always on the latest version.

Most helpful comment

@Basel78 You can have your tsconfig.json has these two lines under compilerOptions

    "target": "es2015",
    "lib": [ "dom", "es2015" ],

All 5 comments

Fixed by adding "es2015.symbol", "es2015.symbol.wellknown" to the lib property in my tsconfig.

Hi,
I had the issue and used your solution but that left me with those errors:

error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.

Any Idea how to fix those errors or why its thrown.

Thanks

@Basel78 You probably set --noLib?

@Basel78 you probably also need to add "es5" to the lib property as well.

@Basel78 You can have your tsconfig.json has these two lines under compilerOptions

    "target": "es2015",
    "lib": [ "dom", "es2015" ],
Was this page helpful?
0 / 5 - 0 ratings