【问题标题】:ANGULAR-CLI - VISUAL CODE: Uncaught TypeError: Cannot read property 'NODE_DEBUG' of undefinedANGULAR-CLI - 可视代码:未捕获的类型错误:无法读取未定义的属性“NODE_DEBUG”
【发布时间】:2021-02-18 23:38:12
【问题描述】:

我有一个使用 Visual Code 使用 Angular-CLI 开发的应用程序:

  angular/cli: 9.0.3,
  npm: '6.14.8',
  ares: '1.16.1',
  brotli: '1.0.9',
  cldr: '37.0',
  icu: '67.1',
  llhttp: '2.1.3',
  modules: '83',
  napi: '7',
  nghttp2: '1.41.0',
  node: '14.15.0',
  openssl: '1.1.1g',
  tz: '2020a',
  unicode: '13.0',
  uv: '1.40.0',
  v8: '8.4.371.19-node.17',
  zlib: '1.2.11'

多年来,我一直在编译和运行我的应用程序,没有出现任何问题,但在成功编译后突然出现:

$ ng serve

chunk {main} main.js, main.js.map (main) 6.16 MB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 233 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 1.1 MB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 1.58 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 13.9 MB [initial] [rendered]
Date: 2020-11-05T17:58:57.468Z - Hash: fc25bd5314199aca3ed8 - Time: 56147ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
: Compiled successfully.

应用程序挂起,我在浏览器检查器中收到以下错误消息:

Uncaught TypeError: Cannot read property 'NODE_DEBUG' of undefined
    at Object../node_modules/util/util.js (util.js:109)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/bl/bl.js (bl.js:3)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/msgpack5/index.js (index.js:5)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/autobahn/lib/autobahn.js (autobahn.js:22)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/autobahn/index.js (index.js:14)
    at __webpack_require__ (bootstrap:79)

很抱歉,我不能给你更多的细节,但我真的一无所知。谷歌搜索甚至不会产生有意义的链接来尝试解决问题。我想知道是否有人偶然发现了同样的问题并可以指导我正确的方向。

【问题讨论】:

    标签: visual-studio-code angular-cli


    【解决方案1】:

    好吧,在运行“ng build”后,我发现了有关 crypto-js 库的警告。

    我必须安装 crypto-js V3.3.0 才能让我的应用程序再次运行。该库的最新版本将不起作用。

    希望这会对某人有所帮助,但如果您能解释为什么这样做有效,请随时添加到我的答案中。

    【讨论】:

    • 我也有同样的问题!你现在使用的是什么版本的 crypto-js?我有一个刚刚升级到的 Angular 13 应用程序,现在该站点将无法运行并出现该 node_debug 错误
    猜你喜欢
    • 1970-01-01
    • 2020-10-11
    • 1970-01-01
    • 2016-01-25
    • 2021-12-22
    • 2021-04-22
    • 2015-01-06
    • 2017-07-26
    相关资源
    最近更新 更多