I am trying to import and work with swagger-parser within a sample Angular project created with the Angular CLI. When I imported the library, I had to get around some build issues, but now I'm just facing this error everytime I try to build:
ERROR in node_modules/@apidevtools/swagger-parser/lib/index.d.ts(327,17): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try npm i @types/node and then add node to the types field in your tsconfig.
node_modules/@apidevtools/swagger-parser/lib/index.d.ts(327,43): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try npm i @types/node and then add node to the types field in your tsconfig.
node_modules/@apidevtools/swagger-parser/lib/index.d.ts(376,20): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try npm i @types/node and then add node to the types field in your tsconfig.
From the error, it looks like Buffer isn't being resolved at all. When I install the types for node, it still returns this error. Does anyone know what the issue could be here? I installed the latest version of swagger-parser out currently, which is 10.0.2.
I've tried the following steps before this:
Installed the openapi-types package (Initially it was not installed). This removed a number of errors.
Hello,
I am trying to import and work with
swagger-parser
within a sample Angular project created with the Angular CLI. When I imported the library, I had to get around some build issues, but now I'm just facing this error everytime I try to build:From the error, it looks like Buffer isn't being resolved at all. When I install the types for node, it still returns this error. Does anyone know what the issue could be here? I installed the latest version of
swagger-parser
out currently, which is10.0.2
.I've tried the following steps before this:
openapi-types
package (Initially it was not installed). This removed a number of errors.@types/node
package a couple times.Any help is greatly appreciated!