agea/CmisJS

error: TS2749: 'Buffer' refers to a value but is being used as a type here

Opened this issue · 1 comments

I'm getting these errors when I try to build our project. We are using Angular 8 and Typescript 3.5.3. A search shows a similar error for StringDecoder, which was fixed in @types/node. I just upgraded our version of @types/node to the latest, 13.13.5, and still get the same error.

An unhandled exception occurred: node_modules/cmis/src/cmis.ts(228,50): error TS2749: 'Buffer' refers to a value, but is being used as a type here.
node_modules/cmis/src/cmis.ts(326,34): error TS2749: 'Buffer' refers to a value, but is being used as a type here.
node_modules/cmis/src/cmis.ts(793,32): error TS2749: 'Buffer' refers to a value, but is being used as a type here.
node_modules/cmis/src/cmis.ts(883,32): error TS2749: 'Buffer' refers to a value, but is being used as a type here.
node_modules/cmis/src/cmis.ts(1014,32): error TS2749: 'Buffer' refers to a value, but is being used as a type here.
node_modules/cmis/src/cmis.ts(1092,32): error TS2749: 'Buffer' refers to a value, but is being used as a type here.
node_modules/cmis/src/cmis.ts(1118,32): error TS2749: 'Buffer' refers to a value, but is being used as a type here.

I found the fix, I needed this in tsconfig.json

    "typeRoots": ["node_modules/@types"],
    "types": ["node"],