angular项目执行npm run dev 时报错解决DeprecationWarning: Access to process.binding('http_parser') is depre...

启动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

然后再重新运行即可解决

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容