Angular 使用“解决我的加密时间错误”的详细步骤;“加密浏览器化”;

Angular 使用“解决我的加密时间错误”的详细步骤;“加密浏览器化”;,angular,typescript,types,Angular,Typescript,Types,我在加载Angular 8应用程序时遇到了这种类型的错误 默认编码.js:6未捕获类型错误:process.version.split不是函数 我如何解决这个问题? 我使用的是Angular 8,Nodejs 12.0。 我还使用完全类型的脚本代码 import { Buffer } from 'buffer/'; import * as crypto from "crypto-browserify"; .... encrypt(plaintext): string { if (!this.en

我在加载Angular 8应用程序时遇到了这种类型的错误

默认编码.js:6未捕获类型错误:process.version.split不是函数

我如何解决这个问题? 我使用的是Angular 8,Nodejs 12.0。 我还使用完全类型的脚本代码

import { Buffer } from 'buffer/';
import * as crypto from "crypto-browserify";
....
encrypt(plaintext): string {
if (!this.enabled)
return plaintext;
let buffer = new Buffer(plaintext);
let encrypted = crypto.privateEncrypt(this.privateKey, buffer);
alert(encrypted.toString('base64'))
}
decrypt(cypher): string {
if (!this.enabled)
return cypher;
let buffer = Buffer.from(cypher`enter code here`, 'base64');
let plaintext = crypto.publicDecrypt(this.publicKey, buffer);
alert(plaintext.toString('utf8'))
}
错误是

默认编码.js:6未捕获类型错误:process.version.split不是函数 在Object../node_modules/pbkdf2/lib/default-encoding.js(default-encoding.js:6)