启动项目报错:digital envelope routines::unsupported解决

最近写reacte的项目,在其他电脑下载依赖启动项目时候报错:

Starting the development server...

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

Node.js v18.17.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

主要是node17版本问题引起的问题,解决方式

  1. 第一种是降低node版本,使用node17以下版本
  2. 第二种在启动命令加语句命令set NODE_OPTIONS=--openssl-legacy-provider &
"scripts": {
    "start": "set NODE_OPTIONS=--openssl-legacy-provider & react-scripts start",
  },

改好之后直接启动项目
npm/pnpm run start || yarn

posted @ 2023-11-27 11:24  化作繁星  阅读(646)  评论(0)    收藏  举报  来源