Möglichkeiten zur Behebung des Fehlers „Fehler: Fehler:0308010C:Digital Envelope Routines::unsupported' in Nodejs 18
P粉121081658
P粉121081658 2023-10-18 15:53:45
0
2
779

Ich brauche Hilfe bei meiner NuxtJS-Anwendung.

Kürzlich bekam ich einen ESLint-Konflikt in der Anwendung, nachdem ich sie eine Weile (2 Monate) ohne Aktualisierung gelassen hatte. Nachdem ich mit der Arbeit daran begonnen hatte, stellte der Versuch, das ESLint-Problem zu lösen, eine Herausforderung dar. Dann musste ich das Projekt auf neuere Versionen von Node und ESLint migrieren.

Danach habe ich das Konfliktproblem gelöst und mein Projekt kann meine Abhängigkeiten installieren, aber jetzt startet der Server nicht. Node gibt jetzt einen Fehler aus, den ich nicht einmal beheben kann. Ich weiß nicht, ob viele andere nach dem Upgrade ihrer Node.js-Version mit diesem Problem konfrontiert sind, aber es gibt einen Fehler bezüglich der nicht unterstützten Hash-Funktion aus.

Hier ist ein Screenshot des Terminalfehlers, der den Start meines Servers verhindert:

Ich habe bereits alle ESLint- und Syntaxfehler behoben, die mit der Migration einhergingen, daher weiß ich nicht, was ich sonst noch tun soll.

Hier ist ein Ausschnitt meiner nuxt.config.js-Datei:

export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'heritage-fd',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
      { name: 'format-detection', content: 'telephone=no' }
    ],
    
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ],
    
    script: [
      {
        src: '~/static/css/bootstrap.min.js',
      },
    ],
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    {src: '~/static/css/bootstrap.min.css', lang: 'scss'},
    {src: '~/assets/scss/custom.scss', lang: 'scss'},
    {src: "~layouts/global.css"},
    {src: '~/static/css/style.css', lang: 'scss'},
    {src: '~/assets/css/main.css'}
    
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
   plugins: [
    "~/plugins/vee-validate.js",
    { src: '~/plugins/persistedState.client.js', ssr: false }
   ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
    // https://go.nuxtjs.dev/eslint
    '@nuxtjs/eslint-module',
    'nuxt-gsap-module',
    '@nuxtjs/fontawesome',
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
    // https://go.nuxtjs.dev/pwa
    '@nuxtjs/pwa',
    '@nuxtjs/auth-next',
    'nuxt-vue-select'
  ],

  // Axios module configuration: https://go.nuxtjs.dev/config-axios
  axios: {
    // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
    baseURL: 'http://localhost:8000/api/',
    
  },

  // PWA module configuration: https://go.nuxtjs.dev/pwa
   pwa: {
    manifest: {
      lang: 'en',
    },
  },

  // Build Configuration: https://go.nuxtjs.dev/config-build
 build: {
    transpile: ["vee-validate/dist/rules"],
    vendor: ["vue-tables-2"]
  },
}


P粉121081658
P粉121081658

Antworte allen(2)
P粉044526217

就我而言,当我运行 npm run build 时,这发生在我的 Github Actions 构建管道中。

我能够通过提供以下环境参数来修复它:

export NODE_OPTIONS=--openssl-legacy-provider

根据我所读到的内容,这个节点选项也可以在 package.json 中设置。

这似乎比将 Nodejs 降级到 v16 容易一些。

P粉090087228

关于这个错误,经过大量研究后,我终于发现整个错误是在nodejs升级到v18.12.1版本时出现的,所以我建议所有遇到同样问题的最近刚刚升级tio node v18.12.1的人降级回到节点 v16.0.0,如果您需要这方面的帮助,您可以使用 nvm

下面概述了一些步骤,以及一些资源链接

`

  1. 下载并安装 nvm 按照此处的说明进行操作
  1. 安装 Nodejs v16.0.0 nvm安装16.0.0

  2. 卸载nodejs v18.12.1 nvm uninstall 18.12.1 或您自己的节点版本

我确实这对某人有帮助,就像对我一样,我知道框架错误带来的痛苦。如果您需要进一步帮助,请发表评论。 谢谢。

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!