Angular 找不到名称';缓冲区';角度应用中的误差
我正在处理我的应用程序,这个错误消息开始出现,我不知道为什么。一切都很好,我不确定我能做些什么来导致这些错误的发生。我已尝试安装@types/node并添加了Angular 找不到名称';缓冲区';角度应用中的误差,angular,typescript,npm,Angular,Typescript,Npm,我正在处理我的应用程序,这个错误消息开始出现,我不知道为什么。一切都很好,我不确定我能做些什么来导致这些错误的发生。我已尝试安装@types/node并添加了 "angularCompilerOptions": { "types" : ["node"] } 到我的tsconfig.json,但这不起作用 ERROR in node_modules/@angular/compiler-cli/src/ngtsc/file_sy
"angularCompilerOptions": {
"types" : ["node"]
}
到我的tsconfig.json,但这不起作用
ERROR in node_modules/@angular/compiler-cli/src/ngtsc/file_system/src/types.d.ts:37:43 - error
TS2591: 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.
37 readFileBuffer(path: AbsoluteFsPath): Buffer;
node_modules/@angular/compiler-cli/src/ngtsc/file_system/src/types.d.ts:38:52 - error TS2591: 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.
38 writeFile(path: AbsoluteFsPath, data: string | Buffer, exclusive?: boolean): void;
node_modules/@angular/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.d.ts:10:43 - error
TS2591: 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.
10 readFileBuffer(path: AbsoluteFsPath): Buffer;
node_modules/@angular/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.d.ts:11:52 - error
TS2591: 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.
11 writeFile(path: AbsoluteFsPath, data: string | Buffer, exclusive?: boolean): void;
我真的被难住了。有没有解决这个问题的办法?可能只是删除节点_模块并运行npm i…?我尝试了这个方法,但不幸的是,它不起作用。