简体   繁体   English

错误:未捕获的 ReferenceError:未定义进程

[英]error: Uncaught ReferenceError: process is not defined

In my project, I'm using angular 6 with Spring-boot and what I want to know is how to resolve the error called在我的项目中,我将 angular 6 与 Spring-boot 一起使用,我想知道的是如何解决名为

Uncaught ReferenceError: process is not defined at Object../node_modules/util/util.js (util.js:109)未捕获的 ReferenceError:进程未在 Object../node_modules/util/util.js (util.js:109) 中定义

In my util.js the error is highlighted as follows but I don't know to resolve this.在我的util.js ,错误突出显示如下,但我不知道如何解决这个问题。

if (process.env.NODE_DEBUG) {
  var debugEnv = process.env.NODE_DEBUG;
  debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')
    .replace(/\*/g, '.*')
    .replace(/,/g, '$|^')
    .toUpperCase();
  debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');
}

在此处输入图片说明

Note: Recently I have installed material community components package using npm install material-community-components注意:最近我使用npm install material-community-components安装了材料社区组件包

There are similer questions like this but nothing helped me yet.有喜欢similer问题, 但没有任何帮助我呢。 This is my package.json file.这是我的package.json文件。

In my case i have added below code of block in polyfills.ts & issue resolve:就我而言,我在 polyfills.ts 和问题解决中添加了以下块代码:

(window as any).process = {
  env: { DEBUG: undefined },
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM