angular项目执行npm run dev 时报错解决Depr

2024-08-12  本文已影响0人  MAYDAY77

启动angular项目时,一直启动不起来,报以下错误,node版本也没有问题,查看是环境变量的问题。

(node:61471) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.

(Use `node --trace-deprecation ...` to show where the warning was created)

ℹ 「wds」: Project is running at http://127.0.0.1:4200/webpack-dev-server/

ℹ 「wds」: webpack output is served from /

ℹ 「wds」: 404s will fallback to //index.html

10% building 4/5 modules 1 active /Users/wangxiaoya/abs-web/abs-web/node_modules/webpack-dev-server/client/index.js?http://0.0.0.0:0/sockjs-node&sockPath=/sockjs-nodenode:internal/crypto/hash:69

  this[kHandle] = new _Hash(algorithm, xofLen);

                  ^

Error: error:0308010C:digital envelope routines::unsupported

解决方法: 

在terminal执行以下两行指令,设置一下环境变量,重新运行angular项目即可

export NODE_OPTIONS=--openssl-legacy-provider  

set NODE_OPTIONS=--openssl-legacy-provider

然后再重新运行即可解决

上一篇 下一篇

猜你喜欢

热点阅读