做酒类网站,关键词的选取原则有,被网上教开网店的骗了怎么办,企业网站策划书制作问题描述
在使用vuepress搭建博客的时候#xff0c;运行项目发现报错了#xff0c;检查了node的版本是18#xff0c;之前用的是16或14的版本#xff0c;现在报#xff1a;Error: error:0308010C:digital envelope routines::unsupported错误。
查找了一些资料#xff0…问题描述
在使用vuepress搭建博客的时候运行项目发现报错了检查了node的版本是18之前用的是16或14的版本现在报Error: error:0308010C:digital envelope routines::unsupported错误。
查找了一些资料大致明白了报错的原因
主要是因为node 17 版本发布了 OpenSSL3.0 对算法和秘钥大小增加了更为严格的限制node 17之前版本没影响但17和之后版本会出现这个错误。这不是巧了嘛这不是我正好是用的18的所以报错了。
error: error:0308010C:digital envelope routines::unsupportedat new Hash (node:internal/crypto/hash:71:19)at Object.createHash (node:crypto:133:10)解决方法
打开我的vue项目然后在项目中 package.json 的 scripts 中新增 SET NODE_OPTIONS–openssl-legacy-provider。
没改之前的代码 scripts: {dev: vue-cli-service serve,build:prod: vue-cli-service build},改之后的代码 scripts: {dev: SET NODE_OPTIONS--openssl-legacy-provider vue-cli-service serve,build:prod: SET NODE_OPTIONS--openssl-legacy-provider vue-cli-service build},