简体   繁体   English

尝试在节点中编译 Angular 应用程序时出错

[英]Error While trying to Compile Angular Application in node

This is the error which occurs when I try to run ng serve --open for my app, And it also shows error while ng --version to check version it shows node 17 is not supported with this angular, but when I try to run another app that works but which I downloaded doesn't.这是当我尝试为我的应用程序运行 ng serve --open 时发生的错误,并且在 ng --version 检查版本时也显示错误,它显示此 angular 不支持节点 17,但是当我尝试运行时另一个可以运行但我下载的应用程序没有。

/ Generating browser application bundles (phase: building)...node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (D:\Training\Angular\mCart\node_modules\webpack\lib\util\createHash.js:145:18)
    at BulkUpdateDecorator.update (D:\Training\Angular\mCart\node_modules\webpack\lib\util\createHash.js:46:50)
    at RawSource.updateHash (D:\Training\Angular\mCart\node_modules\webpack\node_modules\webpack-sources\lib\RawSource.js:77:8)
    at NormalModule._initBuildHash (D:\Training\Angular\mCart\node_modules\webpack\lib\NormalModule.js:880:17)
    at handleParseResult (D:\Training\Angular\mCart\node_modules\webpack\lib\NormalModule.js:946:10)
    at D:\Training\Angular\mCart\node_modules\webpack\lib\NormalModule.js:1040:4
    at processResult (D:\Training\Angular\mCart\node_modules\webpack\lib\NormalModule.js:755:11)
    at D:\Training\Angular\mCart\node_modules\webpack\lib\NormalModule.js:819:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

You could be running with the latest version of Node, which is not officially supported by Angular, yet.您可能正在运行最新版本的 Node,但 Angular 尚未正式支持该版本。 https://angular.io/guide/setup-local#prerequisites https://angular.io/guide/setup-local#prerequisites

Install the LTS version of Node instead and try again => https://nodejs.org/en/download/请安装 LTS 版本的 Node 并重试 => https://nodejs.org/en/download/

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

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