赞
踩
问题: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 文件,修改如下:
- "scripts": {
- "serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
- "build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
- "lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
- },
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。