当前位置:   article > 正文

解决 Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypt

error:0308010c:digital envelope routines::unsupported at new hash (node:inte

问题:Ubuntu VSCode 命令行运行 npm run serve 报错:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)

参考: How To Fix Error - "Digital Envelope Routines::Unsupported" in Node.js or React ? - Gankrin

 

解决方法:

 找到项目package.json 文件,修改如下:

  1. "scripts": {
  2. "serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
  3. "build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
  4. "lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
  5. },
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/755919
推荐阅读
相关标签
  

闽ICP备14008679号