If you are facing this error and you do not want to change your main configuration, an easy fix would be to use the following approach. I am not sure if it is recommended as a good practice, though.
Feel free to correct it.
Initially, let’s say this is the scripts section of my package.json
file:
...
"version": "1.0.0",
"scripts": {
...
"build": "npm run build:test-app:testing",
"build:test-app:testing": "ng build test-app --deploy-url https://test-app.com/ --configuration=test-config",
...
},
"private": true,
...
In order to use this export NODE_OPTIONS=--openssl-legacy-provider
you can do the following:
"version": "1.0.0",
"scripts": {
....
"build": "NODE_OPTIONS=--openssl-legacy-provider npm run build:test-app:testing”,
"build:test-app:testing": "NODE_OPTIONS=--openssl-legacy-provider ng build test-app --deploy-url https://test-app.com/ --configuration=test-config"
...
},
"private": true,
Take note of the build scripts. I have added an option: NODE_OPTIONS=--openssl-legacy-provider
This helps solve this error in Node.js version 17.
For those with the flexibility of changing the build system’s Node.js version, just switch to a version lower that 17, e.g., version 16.
For Docker, the use case of using this initially, which always pulls the latest version:
...
FROM node:alpine
...
You can switch to something like:
...
FROM node:16-alpine3.12
...
Содержание
- How To Fix Error – “Digital Envelope Routines::Unsupported” in Node.js or React ?
- How To Fix Error – “Digital Envelope Routines::Unsupported” in Node.js or React ?
- Option 1:
- Option 2:
- Сообщение об ошибке «ошибка: 0308010C: подпрограммы цифрового конверта :: не поддерживаются»
- 34 ответа
- Опасность
- Причина ошибки
- Правильное (безопасное) решение
- Error 0308010c digital envelope routines unsupported что делать
- error:0308010C:digital envelope routines::unsupported [Fixed] #
- Update your react-scripts version if you use create-react-app #
- Try updating your NPM packages #
- Downgrade to Node.js version 16 #
How To Fix Error – “Digital Envelope Routines::Unsupported” in Node.js or React ?
How To Fix Error – “Digital Envelope Routines::Unsupported” in Node.js or React ?
In this post, we will see How To Fix Error – “Digital Envelope Routines::Unsupported” in Node.js, React.js, Angular.js, Vue.js, Docker etc. Various facets of the error –
The common reason for such issue is Version conflict issue or Version not in-sync with other entities in the system. Sometimes using latest Node.js might throw such error. Lot of projects still depend on Webpack 4 but the latest Node.js might not be compatible with that. Majorly this is caused by the latest Node.js Version compatible issues with OpenSSL.
Check you node version
We will try out the below two options to see if that helps to fix the issue.
Option 1:
If you want to stick to your existing Node.js without down-grading it, then try the below steps –
- Use openssl-legacy-provider by setting it as an environment variable
-
- Windows – Set below as environment variable
-
- MacLinux – Set below in
/.bashrc so that it stays even after you logoutlogin back.
- MacLinux – Set below in
-
- For Docker – add the Highlighted bit in Dockekrfile
- The openssl-legacy-provider parameter should be placed inside your package.json. Add the part highlighted in Red.
-
- For Angular, use the below and then use npm start
-
- For React, use the below in the package.json file.
- For Vue.js, use the below in the package.json file.
- Also add something like the below Highlighted –
Option 2:
At this point, I am assuming Option 1 somehow did not work out to fix the issue. The next option we can try is to roll-back to an older version of Node.js (STABLE) which is compatible with Webpack and doesn’t render this issue.
- The version that you are using might not be compatible with some Webpack components.
- Remove the current Node.js version and go-back i.e. Downgrade to an older Stable version. e.g. From Node.js 17+ go back to Node.js version 16+.
- Windows – Uninstall node from the “Add or remove programs”. Alternatively use https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows to setup nvm and control Node version through it
-
- LinuxMac –
- Once done, cross check if node version is downgraded
- Delete the folder “node_modules” .
Источник
Сообщение об ошибке «ошибка: 0308010C: подпрограммы цифрового конверта :: не поддерживаются»
Я создал проект IntelliJ IDEA React по умолчанию и получил следующее:
34 ответа
В вашем package.json: измените эту строку
Если мы используем текущую LTS-версию Node.js, то этой ошибки не будет. Понизьте версию Node.js до текущей версии LTS (16.13.0).
Установить требуемую версию можно несколькими способами. Один из них использует nvm (менеджер версий Node.js).
Шаг 2: nvm install 16.13.0 (или lts)
Это версия для Node.js.
У меня есть эта ошибка на Node.js 17, но это нормально, когда я переключаю свою версию Node.js на более старую версию (16) с помощью nvm .
Некоторые популярные ответы не помогли.
И некоторые популярные ответы были неприменимы, изменяя файл package.json :
Это вызвано последними проблемами совместимости node.js V17 с OpenSSL , см. this и эту проблему на GitHub.
Самый простой способ — просто перейти с node.js V17 на node.js V16 . См. этот пост о том, как перейти на более раннюю версию node.js .
Я нашел следующие команды на GitHub:
Для Windows используйте следующую команду в cmd:
Для Unix используйте:
Опасность
На этот вопрос есть более 30 ответов, большинство из которых предлагают либо понизить версию Node.js до предыдущей версии 17, либо использовать устаревшего поставщика SSL. Оба эти решения представляют собой взломы, которые оставляют ваши сборки открытыми для угроз безопасности.
Причина ошибки
В Node.js v17 разработчики Node.js закрыли дыру в безопасности поставщика SSL. Это исправление было критическим изменением, которое соответствовало аналогичным критическим изменениям в пакетах SSL в NPM. Когда вы пытаетесь использовать SSL в Node.js v17 или более поздней версии без обновления этих пакетов SSL в вашем package.json , вы увидите эту ошибку.
Правильное (безопасное) решение
Используйте последнюю версию Node.js, а также пакеты с последними исправлениями безопасности.
Для многих людей следующая команда решит проблему:
Однако имейте в виду, что для сложных сборок приведенная выше команда будет использовать критические исправления безопасности, которые могут потенциально нарушить вашу сборку.
Если вы используете react-scripts , теперь вы можете просто обновиться до версии 5.0.0 (или выше), которая, похоже, устранила эту проблему (включает более новую версию веб-пакета).
Это распространенная ошибка, когда пакеты в проекте не обновляются и версия React, которую вы используете, не является последней.
Чтобы решить эту проблему, вам нужно изменить файл package.json следующим образом: изменить это 👇
Я столкнулся с той же проблемой с Node.js 17.0.1. Я решил это, выполнив следующие действия:
Откройте Панель управления → Программа и компоненты → Node.js и удалите Node.js, щелкнув правой кнопкой мыши
Перейдите на веб-сайт https://nodejs.org/en/ и загрузите версия и установка.
И загрузите рекомендованную версию для большинства пользователей.
Затем удалите Node.js со своего ПК и установите рекомендуемую версию.
Насколько я понимаю, это проблема команды разработчиков. Они исправят это как можно скорее, но пока используйте рекомендованную версию, и все будет в порядке.
Если вы получаете эту ошибку при использовании GatsbyJs, все, что вам нужно сделать, это понизить версию node до долгосрочной поддержки. Нет другого спасения
Это не может быть ответом на вопрос для всех. Но для тех, кто использует узел 17 и выше в докере, понижение версии, как все говорили, будет полезно. Нет необходимости в open-legacy-sslprovider. Простой переключатель в вашем Dockerfile от использования
Исправляет эту проблему в докере.
Для угловых приложений:
Вы также можете отредактировать скрипт npm start в package.json. Вместо
Когда вы запускаете npm run start в терминале/командной строке, он сначала установит NODE_OPTIONS , чтобы избежать проблемы.
Он работал с Node.js v18.7.0.
Сегодня я столкнулся с этой проблемой и решил ее, переключив версию Node.js с помощью nvm.
Я работал над парой личных проектов, используя Node.js, Next.js и React. Со мной часто случается то, что я не помню точно, какая версия Node .js я использую для какого проекта.
И поэтому обычно я пытался использовать Node.js 16 для проекта, который в настоящее время использует Node.js 14 (сейчас я использую Node.js 17).
Я не придумал лучшего способа запомнить версию Node.js для каждого проекта, поэтому обычно я просто сохранял все команды, которые мне нужно было запустить для запуска приложения, в readme.MD.
Если вы столкнулись с этой ошибкой и не хотите изменять свою основную конфигурацию, простым решением будет использование следующего подхода. Однако я не уверен, рекомендуется ли это в качестве хорошей практики.
Не стесняйтесь исправлять.
Сначала предположим, что это раздел сценариев моего файла package.json :
Чтобы использовать этот export NODE_OPTIONS=—openssl-legacy-provider , вы можете сделать следующее:
Обратите внимание на сценарии сборки. Я добавил вариант: NODE_OPTIONS=—openssl-legacy-provider
Это помогает решить эту ошибку в Node.js версии 17.
Для тех, у кого есть возможность изменить версию системы сборки Node.js, просто переключитесь на версию ниже 17, например, версию 16.
Для Docker вариант использования изначально, который всегда извлекает последнюю версию:
Вы можете переключиться на что-то вроде:
Та же ошибка с версией узла v18.0.0 и версии nuxt framework 2.15 при запуске сервера разработки и будет исправлено:
Я столкнулся с теми же ошибками при сборке hoppscotch с помощью Node.js v18.4.0, и set NODE_OPTIONS=—openssl-legacy-provider спас меня!
Это сработало для меня в моем приложении expo (переход с Node.js 17 на Node.js 12 или 14).
Если у вас установлен nvm, вы можете изменить версию узла:
Сначала проверьте версии Node.js в nvm:
Во-вторых, установите версию 12 или 14:
Не удалось построить преобразователь: ошибка: ошибка: 0308010C: подпрограммы цифрового конверта :: неподдерживаемый
Самым простым и легким решением указанной выше ошибки является понижение версии Node.js до версии 14.18.1. А затем просто удалите папку node_modules и попробуйте перестроить свой проект, и ваша ошибка должна быть решена.
Это сработало для меня (переход с Node.js 17 на Node.js 16):
Затем откатитесь к узлу —lts (узел v16.13.2 (npm v8.1.2)) для этого используйте nvm
Для оболочки bash
Для оболочки зш
После установки нвм
Это решение сработало для меня.
Эта ошибка возникает в Node.js версии 17+, поэтому попробуйте понизить версию Node.js.
- Удалите Node.js с компьютера.
- Загрузите Node.js версии 16 и установите его снова с https://nodejs.org/. скачать/релиз/v16.13.0/
Эта ошибка связана с тем, что node.js 17 использует OpenSSL3, который изменил код для контекста инициализации семейства md (включая md4), и это критическое изменение. Ошибка также может возникнуть, если вы создаете приложение с помощью сборки докеров, поскольку по умолчанию он загружает последнюю версию Node.JS.
Установите диспетчер версий узла nvm:
Установите последнюю LTS-версию:
Я столкнулся с этой проблемой в сборке Docker, и я добавил эту строку в файл Docker:
Для локальной разработки добавьте переключатель в файл package.json .
Запуск аудита решил проблему для меня
Была эта проблема при использовании VueJS.
Недостатком использования -openssl-legacy-provider является то, что оно не поддерживается более старыми версиями Node. Старые версии Node просто не запускаются, когда указан этот флаг.
Но я по-прежнему хочу обеспечить совместимость с Node v16 и более ранними версиями.
VueJS использует алгоритм md4 для генерации хэшей (на самом деле это WebPack под капотом). md4 можно легко заменить на md5 для таких целей. Тип используемого алгоритма в большинстве случаев жестко запрограммирован, поэтому нет возможности настроить другой алгоритм.
Поэтому я придумал другой обходной путь. Функция, которая перехватывает исходный вызов createHash() из модуля crypto и заменяет его модифицированной версией. Это начало моего файла vue.config.js :
Вот два варианта сейчас —
1. Попробуйте удалить Node.js версии 17+ и переустановить Node.js версии 16+.
Вы можете переустановить текущую версию js узла LTS с их официального сайта. или более конкретные загрузки из здесь;
Вы можете использовать NVM (Диспетчер версий узла)
- Пользователи Linux и Mac могут использовать этот пакет nvm — https://github.com/nvm-sh/. нвм
- Пользователи Windows могут использовать этот пакет nvm — https://github.com/coreybutler/nvm-windows
2. Откройте терминал и вставьте их, как описано:
Источник
Error 0308010c digital envelope routines unsupported что делать
Reading time В· 4 min
error:0308010C:digital envelope routines::unsupported [Fixed] #
The «error:0308010C:digital envelope routines::unsupported» occurs because Node.js v17 and later use OpenSSL v3.0 which has had breaking changes. To resolve the error, set the NODE_OPTIONS environment variable to —openssl-legacy-provider when running your development server.
Open your terminal and run the specific command for your shell type.
The —openssl-legacy-provider option is needed when using the latest version of Node.js, because Node.js 17 and later uses OpenSSL 3.0 which has had some breaking changes.
If the error persists, try using the —openssl-legacy-provider flag when issuing the command in your package.json file.
Here is an example of how you would do that with create-react-app .
Simply add —openssl-legacy-provider at the end of your command.
If you get an error that «node: —openssl-legacy-provider is not allowed in NODE_OPTIONS», unset the NODE_OPTIONS environment variable and rerun the command.
Try to rerun your script after deleting the environment variable.
If that doesn’t help, try to set the NODE_OPTIONS environment variable right before issuing the command.
Install the cross-env package to resolve the error.
And prefix the environment variable and the command with cross-env .
We simply prefixed the command in the package.json script with NODE_OPTIONS=—openssl-legacy-provider , e.g. NODE_OPTIONS=—openssl-legacy-provider YOUR_COMMAND_HERE .
For example, for an Angular app, your package.json script would look similar to the following.
If you use create-react-app , update your react-scripts version because the package introduced some fixes regarding its Webpack config in version 5.0.0 .
Update your react-scripts version if you use create-react-app #
The «error:0308010C:digital envelope routines::unsupported» also occurs if you have an outdated version of react-scripts in your create-react-app project.
Open your terminal and run the following command to update your version of react-scripts .
If the error persists, try to delete your node_modules and package-lock.json (not package.json ) files, rerun the npm install and restart your dev server.
Try to restart your development server after updating your react-scripts version.
You can install a specific version using the following command.
The version of Webpack in react-scripts version 5.0.0+ has been updated which should resolve the issue in your create-react-app project.
Try updating your NPM packages #
The following command installs major updates to top-level dependencies, which might introduce breaking changes to your project if you rely on older package versions.
Updating the versions of your packages might solve the error because the maintainers might have introduced security patches in more recent versions.
If the error persists, try running the npm update command.
If you still get an error, try to delete your node_modules and package-lock.json , rerun the npm install command and restart your development server.
Try to restart your development server after running the npm audit fix —force command.
If none of the suggestions helped, you can downgrade your Node.js version to 16.13.0 to resolve the error.
Downgrade to Node.js version 16 #
You can issue the following command to downgrade your Node.js version to 16.13.0 if you use NVM.
The error often occurs when installing Node.js version 17+. Rolling back to version 16.X.X solves it.
The —openssl-legacy-provider option is needed when using the latest version of Node.js, because Node.js 17 and later uses OpenSSL 3.0 which has had some breaking changes.
If you still get the error after downgrading to Node version 16, try to delete your node_modules and package-lock.json , rerun the npm install command and restart your development server.
Restart your development server after issuing the npm install command.
Источник
Я создал проект IntelliJ IDEA React по умолчанию и получил следующее:
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (/Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/NormalModule.js:471:10)
at /Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/NormalModule.js:503:5
at /Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/NormalModule.js:358:12
at /Users/user/Programming Documents/WebServer/untitled/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/user/Programming Documents/WebServer/untitled/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/Users/user/Programming Documents/WebServer/untitled/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
/Users/user/Programming Documents/WebServer/untitled/node_modules/react-scripts/scripts/start.js:19
throw err;
^
Кажется, это недавняя проблема — webpack столкнулся с этим 4 дня назад и все еще работает над это .
34 ответа
Лучший ответ
В вашем package.json: измените эту строку
"start": "react-scripts start"
К
"start": "react-scripts --openssl-legacy-provider start"
351
a1cd
26 Окт 2021 в 21:02
Если мы используем текущую LTS-версию Node.js, то этой ошибки не будет. Понизьте версию Node.js до текущей версии LTS (16.13.0).
Установить требуемую версию можно несколькими способами. Один из них использует nvm (менеджер версий Node.js).
-
Шаг 1. Установите nvm (если не установлен, выполните Установите Node.js локально с помощью Диспетчер версий узла (nvm) )
-
Шаг 2:
nvm install 16.13.0
(или lts)
230
Ashok Bhobhiya
1 Фев 2022 в 18:52
Это версия для Node.js.
У меня есть эта ошибка на Node.js 17, но это нормально, когда я переключаю свою версию Node.js на более старую версию (16) с помощью nvm
.
62
Heretic Monkey
1 Дек 2021 в 19:31
Некоторые популярные ответы не помогли.
export NODE_OPTIONS=--openssl-legacy-provider
И некоторые популярные ответы были неприменимы, изменяя файл package.json
:
"start": "react-scripts --openssl-legacy-provider start"
Это вызвано последними проблемами совместимости node.js V17
с OpenSSL
, см. this < / a> и эту проблему на GitHub.
Самый простой способ — просто перейти с node.js V17
на node.js V16
. См. этот пост о том, как перейти на более раннюю версию node.js
.
59
Gary Bao 鲍昱彤
2 Янв 2022 в 08:55
Я нашел следующие команды на GitHub:
Для Windows используйте следующую команду в cmd:
set NODE_OPTIONS=--openssl-legacy-provider
Для Unix используйте:
export NODE_OPTIONS=--openssl-legacy-provider
39
Peter Mortensen
15 Ноя 2021 в 04:01
Опасность
На этот вопрос есть более 30 ответов, большинство из которых предлагают либо понизить версию Node.js до предыдущей версии 17, либо использовать устаревшего поставщика SSL. Оба эти решения представляют собой взломы, которые оставляют ваши сборки открытыми для угроз безопасности.
Причина ошибки
В Node.js v17 разработчики Node.js закрыли дыру в безопасности поставщика SSL. Это исправление было критическим изменением, которое соответствовало аналогичным критическим изменениям в пакетах SSL в NPM. Когда вы пытаетесь использовать SSL в Node.js v17 или более поздней версии без обновления этих пакетов SSL в вашем package.json
, вы увидите эту ошибку.
Правильное (безопасное) решение
Используйте последнюю версию Node.js, а также пакеты с последними исправлениями безопасности.
Для многих людей следующая команда решит проблему:
npm audit fix --force
Однако имейте в виду, что для сложных сборок приведенная выше команда будет использовать критические исправления безопасности, которые могут потенциально нарушить вашу сборку.
29
Peter Mortensen
15 Авг 2022 в 23:33
Если вы используете react-scripts
, теперь вы можете просто обновиться до версии 5.0.0 (или выше), которая, похоже, устранила эту проблему (включает более новую версию веб-пакета).
5
neo post modern
3 Мар 2022 в 12:04
Это распространенная ошибка, когда пакеты в проекте не обновляются и версия React, которую вы используете, не является последней.
Чтобы решить эту проблему, вам нужно изменить файл package.json следующим образом: изменить это 👇
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
К этому 👇
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
4
erff-on
27 Авг 2022 в 12:16
Я столкнулся с той же проблемой с Node.js 17.0.1. Я решил это, выполнив следующие действия:
-
Откройте Панель управления → Программа и компоненты → Node.js и удалите Node.js, щелкнув правой кнопкой мыши
-
Перейдите на веб-сайт https://nodejs.org/en/ и загрузите версия и установка.
2
Peter Mortensen
15 Ноя 2021 в 03:59
Перейдите на: : https://nodejs.org/en/
И загрузите рекомендованную версию для большинства пользователей.
Затем удалите Node.js со своего ПК и установите рекомендуемую версию.
Насколько я понимаю, это проблема команды разработчиков. Они исправят это как можно скорее, но пока используйте рекомендованную версию, и все будет в порядке.
2
Peter Mortensen
2 Янв 2022 в 05:45
Если вы получаете эту ошибку при использовании GatsbyJs, все, что вам нужно сделать, это понизить версию node до долгосрочной поддержки. Нет другого спасения
2
Enes
29 Мар 2022 в 19:10
Это не может быть ответом на вопрос для всех. Но для тех, кто использует узел 17 и выше в докере, понижение версии, как все говорили, будет полезно. Нет необходимости в open-legacy-sslprovider. Простой переключатель в вашем Dockerfile от использования
From node
Использовать
From node:16.*
Исправляет эту проблему в докере.
2
Nkoro Joseph Ahamefula
3 Апр 2022 в 13:57
Для угловых приложений:
Вы также можете отредактировать скрипт npm start
в package.json. Вместо
"start": "ng serve -o"
К
"start": "set NODE_OPTIONS=--openssl-legacy-provider && ng serve -o"
Когда вы запускаете npm run start
в терминале/командной строке, он сначала установит NODE_OPTIONS
, чтобы избежать проблемы.
2
ggorlen
18 Июн 2022 в 03:44
В PowerShell:
$env:NODE_OPTIONS = "--openssl-legacy-provider"
Он работал с Node.js v18.7.0.
2
Peter Mortensen
15 Авг 2022 в 23:31
Сегодня я столкнулся с этой проблемой и решил ее, переключив версию Node.js с помощью nvm.
Я работал над парой личных проектов, используя Node.js, Next.js и React… Со мной часто случается то, что я не помню точно, какая версия Node .js я использую для какого проекта.
И поэтому обычно я пытался использовать Node.js 16 для проекта, который в настоящее время использует Node.js 14 (сейчас я использую Node.js 17).
Я не придумал лучшего способа запомнить версию Node.js для каждого проекта, поэтому обычно я просто сохранял все команды, которые мне нужно было запустить для запуска приложения, в readme.MD.
1
Peter Mortensen
2 Янв 2022 в 05:53
Если вы столкнулись с этой ошибкой и не хотите изменять свою основную конфигурацию, простым решением будет использование следующего подхода. Однако я не уверен, рекомендуется ли это в качестве хорошей практики.
Не стесняйтесь исправлять.
Сначала предположим, что это раздел сценариев моего файла package.json
:
...
"version": "1.0.0",
"scripts": {
...
"build": "npm run build:test-app:testing",
"build:test-app:testing": "ng build test-app --deploy-url https://test-app.com/ --configuration=test-config",
...
},
"private": true,
...
Чтобы использовать этот export NODE_OPTIONS=--openssl-legacy-provider
, вы можете сделать следующее:
"version": "1.0.0",
"scripts": {
....
"build": "NODE_OPTIONS=--openssl-legacy-provider npm run build:test-app:testing”,
"build:test-app:testing": "NODE_OPTIONS=--openssl-legacy-provider ng build test-app --deploy-url https://test-app.com/ --configuration=test-config"
...
},
"private": true,
Обратите внимание на сценарии сборки. Я добавил вариант: NODE_OPTIONS=--openssl-legacy-provider
Это помогает решить эту ошибку в Node.js версии 17.
Для тех, у кого есть возможность изменить версию системы сборки Node.js, просто переключитесь на версию ниже 17, например, версию 16.
Для Docker вариант использования изначально, который всегда извлекает последнюю версию:
...
FROM node:alpine
...
Вы можете переключиться на что-то вроде:
...
FROM node:16-alpine3.12
...
8
Peter Mortensen
2 Янв 2022 в 05:36
Та же ошибка с версией узла v18.0.0 и версии nuxt framework 2.15 при запуске сервера разработки и будет исправлено:
"scripts": {
"dev": "NODE_OPTIONS=--openssl-legacy-provider nuxt"
}
6
Art Mary
11 Май 2022 в 11:28
Я столкнулся с теми же ошибками при сборке hoppscotch с помощью Node.js v18.4.0, и set NODE_OPTIONS=--openssl-legacy-provider
спас меня!
Журналы
D:coderusthoppscotch-apphoppscotch>pnpm install && pnpm run generate
Scope: all 5 workspace projects
Lockfile is up-to-date, resolution step is skipped
Already up-to-date
packages/codemirror-lang-graphql prepare$ rollup -c
│ Browserslist: caniuse-lite is outdated. Please run:
│ npx browserslist@latest --update-db
│ Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
│
│ src/index.js → dist/index.cjs, ./dist...
│ created dist/index.cjs, ./dist in 2.8s
└─ Done in 4.8s
packages/hoppscotch-data prepare$ tsup src --dts
[20 lines collapsed]
│ CJS distchunk-LZ75CAKS.js 13.00 B
│ DTS Build start
│ DTS ⚡️ Build success in 2261ms
│ DTS distindex.d.ts 714.00 B
│ DTS distrestindex.d.ts 2.18 KB
│ DTS distgraphqlindex.d.ts 589.00 B
│ DTS distcollectionindex.d.ts 1.30 KB
│ DTS distrestcontent-types.d.ts 473.00 B
│ DTS distrestHoppRESTAuth.d.ts 882.00 B
│ DTS disttype-utils.d.d.ts 1.00 B
└─ Done in 3.8s
packages/hoppscotch-js-sandbox postinstall$ pnpm run build
│ > @hoppscotch/js-sandbox@1.0.0 build D:coderusthoppscotch-apphoppscotchpackageshoppscotch-js-sandbox
│ > npx tsc
└─ Done in 8.7s
. prepare$ husky install
│ husky - Git hooks installed
└─ Done in 300ms
packages/hoppscotch-app postinstall$ pnpm run gql-codegen
[12 lines collapsed]
│ [14:58:01] Load GraphQL documents [started]
│ [14:58:01] Load GraphQL documents [completed]
│ [14:58:01] Generate [started]
│ [14:58:01] Generate [completed]
│ [14:58:01] Generate helpers/backend/backend-schema.json [completed]
│ [14:58:02] Load GraphQL documents [completed]
│ [14:58:02] Generate [started]
│ [14:58:02] Generate [completed]
│ [14:58:02] Generate helpers/backend/graphql.ts [completed]
│ [14:58:02] Generate outputs [completed]
└─ Done in 4s
> hoppscotch-app@2.2.1 generate D:coderusthoppscotch-apphoppscotch
> pnpm -r do-build-prod
Scope: 4 of 5 workspace projects
packages/hoppscotch-js-sandbox do-build-prod$ pnpm run build
│ > @hoppscotch/js-sandbox@1.0.0 build D:coderusthoppscotch-apphoppscotchpackageshoppscotch-js-sandbox
│ > npx tsc
└─ Done in 7.5s
packages/hoppscotch-app do-build-prod$ pnpm run generate
│ > hoppscotch-app@2.2.1 generate D:coderusthoppscotch-apphoppscotchpackageshoppscotch-app
│ > nuxt generate --modern
│ i Sentry reporting is disabled (no DSN has been provided)
│ i Production build
│ i Bundling only for client side
│ i Target: static
│ i Using components loader to optimize imports
│ i Discovered Components: node_modules/.cache/nuxt/components/readme.md
│ √ Builder initialized
│ √ Nuxt files generated
│ i Compiling Client
│ ERROR Error: error:0308010C:digital envelope routines::unsupported
│ at new Hash (node:internal/crypto/hash:67:19)
│ at Object.createHash (node:crypto:133:10)
│ at module.exports (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklib
│ at NormalModule._initBuildHash (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_module
│ at handleParseError (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpackl
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoad
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoad
│ at runSyncOrAsync (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at Array.<anonymous> (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloa
│ at Storage.finished (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmenhanced-resolve@4.5.0node_modulese
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmenhanced-resolve@4.5.0node_modulesenhanced-resolveli
│ WARN Browserslist: caniuse-lite is outdated. Please run:
│ npx browserslist@latest --update-db
│ Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
│ ERROR error:0308010C:digital envelope routines::unsupported
│ at new Hash (node:internal/crypto/hash:67:19)
│ at Object.createHash (node:crypto:133:10)
│ at module.exports (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibu
│ at NormalModule._initBuildHash (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_modules
│ at handleParseError (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklib
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js:5
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js:3
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoader
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_moduleslo
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_moduleslo
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoader
│ at context.callback (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmbabel-loader@8.2.3_@babel+core@7.16.12node_modulesbabel
│ D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoaderRunne
│ throw e;
│ ^
│ Error: error:0308010C:digital envelope routines::unsupported
│ at new Hash (node:internal/crypto/hash:67:19)
│ at Object.createHash (node:crypto:133:10)
│ at module.exports (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklib
│ at NormalModule._initBuildHash (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_module
│ at handleParseError (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpackl
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoad
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoad
│ at context.callback (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesload
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmcache-loader@4.1.0_webpack@4.46.0node_modulescache-lo
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmgraceful-fs@4.2.8node_modulesgraceful-fsgraceful-fs.
│ at FSReqCallback.oncomplete (node:fs:201:23) {
│ opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
│ library: 'digital envelope routines',
│ reason: 'unsupported',
│ code: 'ERR_OSSL_EVP_UNSUPPORTED'
│ }
│ Node.js v18.4.0
│ ELIFECYCLE Command failed with exit code 1.
└─ Failed in 8.3s
D:coderusthoppscotch-apphoppscotchpackageshoppscotch-app:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL hoppscotch-app@2.2.1 do-build-prod: `pnpm run generate`
Exit status 1
ELIFECYCLE Command failed with exit code 1.
D:coderusthoppscotch-apphoppscotch>npx browserslist@latest --update-db
Need to install the following packages:
browserslist@4.20.4
Ok to proceed? (y) y
Latest version: 1.0.30001357
Updating caniuse-lite version
$ pnpm up caniuse-lite
caniuse-lite has been successfully updated
No target browser changes
D:coderusthoppscotch-apphoppscotch>pnpm install && pnpm run generate
Scope: all 5 workspace projects
Lockfile is up-to-date, resolution step is skipped
Already up-to-date
packages/codemirror-lang-graphql prepare$ rollup -c
│ Browserslist: caniuse-lite is outdated. Please run:
│ npx browserslist@latest --update-db
│ Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
│
│ src/index.js → dist/index.cjs, ./dist...
│ created dist/index.cjs, ./dist in 2.8s
└─ Done in 4.8s
packages/hoppscotch-data prepare$ tsup src --dts
[20 lines collapsed]
│ CJS distchunk-JUWXSDKJ.js 1010.00 B
│ DTS Build start
│ DTS ⚡️ Build success in 2250ms
│ DTS distindex.d.ts 714.00 B
│ DTS distrestindex.d.ts 2.18 KB
│ DTS distgraphqlindex.d.ts 589.00 B
│ DTS distcollectionindex.d.ts 1.30 KB
│ DTS distrestcontent-types.d.ts 473.00 B
│ DTS distrestHoppRESTAuth.d.ts 882.00 B
│ DTS disttype-utils.d.d.ts 1.00 B
└─ Done in 3.7s
packages/hoppscotch-js-sandbox postinstall$ pnpm run build
│ > @hoppscotch/js-sandbox@1.0.0 build D:coderusthoppscotch-apphoppscotchpackageshoppscotch-js-sandbox
│ > npx tsc
└─ Done in 8.5s
. prepare$ husky install
│ husky - Git hooks installed
└─ Done in 335ms
packages/hoppscotch-app postinstall$ pnpm run gql-codegen
[12 lines collapsed]
│ [15:02:37] Load GraphQL documents [started]
│ [15:02:37] Load GraphQL documents [completed]
│ [15:02:37] Generate [started]
│ [15:02:37] Generate [completed]
│ [15:02:37] Generate helpers/backend/backend-schema.json [completed]
│ [15:02:38] Load GraphQL documents [completed]
│ [15:02:38] Generate [started]
│ [15:02:38] Generate [completed]
│ [15:02:38] Generate helpers/backend/graphql.ts [completed]
│ [15:02:38] Generate outputs [completed]
└─ Done in 3.8s
> hoppscotch-app@2.2.1 generate D:coderusthoppscotch-apphoppscotch
> pnpm -r do-build-prod
Scope: 4 of 5 workspace projects
packages/hoppscotch-js-sandbox do-build-prod$ pnpm run build
│ > @hoppscotch/js-sandbox@1.0.0 build D:coderusthoppscotch-apphoppscotchpackageshoppscotch-js-sandbox
│ > npx tsc
└─ Done in 6.9s
packages/hoppscotch-app do-build-prod$ pnpm run generate
│ > hoppscotch-app@2.2.1 generate D:coderusthoppscotch-apphoppscotchpackageshoppscotch-app
│ > nuxt generate --modern
│ i Sentry reporting is disabled (no DSN has been provided)
│ i Production build
│ i Bundling only for client side
│ i Target: static
│ i Using components loader to optimize imports
│ i Discovered Components: node_modules/.cache/nuxt/components/readme.md
│ √ Builder initialized
│ √ Nuxt files generated
│ i Compiling Client
│ ERROR Error: error:0308010C:digital envelope routines::unsupported
│ at new Hash (node:internal/crypto/hash:67:19)
│ at Object.createHash (node:crypto:133:10)
│ at module.exports (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklib
│ at NormalModule._initBuildHash (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_module
│ at handleParseError (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpackl
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoad
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoad
│ at runSyncOrAsync (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at Array.<anonymous> (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloa
│ at Storage.finished (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmenhanced-resolve@4.5.0node_modulese
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmenhanced-resolve@4.5.0node_modulesenhanced-resolveli
│ WARN Browserslist: caniuse-lite is outdated. Please run:
│ npx browserslist@latest --update-db
│ Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
│ ERROR error:0308010C:digital envelope routines::unsupported
│ at new Hash (node:internal/crypto/hash:67:19)
│ at Object.createHash (node:crypto:133:10)
│ at module.exports (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibu
│ at NormalModule._initBuildHash (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_modules
│ at handleParseError (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklib
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js:5
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js:3
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoader
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_moduleslo
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_moduleslo
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoader
│ at context.callback (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmbabel-loader@8.2.3_@babel+core@7.16.12node_modulesbabel
│ D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoaderRunne
│ throw e;
│ ^
│ Error: error:0308010C:digital envelope routines::unsupported
│ at new Hash (node:internal/crypto/hash:67:19)
│ at Object.createHash (node:crypto:133:10)
│ at module.exports (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklib
│ at NormalModule._initBuildHash (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_module
│ at handleParseError (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpackl
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmwebpack@4.46.0node_moduleswebpacklibNormalModule.js
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoad
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at iterateNormalLoaders (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modules
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesloader-runnerlibLoad
│ at context.callback (D:coderusthoppscotch-apphoppscotchnode_modules.pnpmloader-runner@2.4.0node_modulesload
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmcache-loader@4.1.0_webpack@4.46.0node_modulescache-lo
│ at D:coderusthoppscotch-apphoppscotchnode_modules.pnpmgraceful-fs@4.2.8node_modulesgraceful-fsgraceful-fs.
│ at FSReqCallback.oncomplete (node:fs:201:23) {
│ opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
│ library: 'digital envelope routines',
│ reason: 'unsupported',
│ code: 'ERR_OSSL_EVP_UNSUPPORTED'
│ }
│ Node.js v18.4.0
│ ELIFECYCLE Command failed with exit code 1.
└─ Failed in 8.2s
D:coderusthoppscotch-apphoppscotchpackageshoppscotch-app:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL hoppscotch-app@2.2.1 do-build-prod: `pnpm run generate`
Exit status 1
ELIFECYCLE Command failed with exit code 1.
D:coderusthoppscotch-apphoppscotch>echo %NODE_OPTIONS%
%NODE_OPTIONS%
D:coderusthoppscotch-apphoppscotch>set NODE_OPTIONS=--openssl-legacy-provider
D:coderusthoppscotch-apphoppscotch>echo %NODE_OPTIONS%
--openssl-legacy-provider
D:coderusthoppscotch-apphoppscotch>pnpm run generate
> hoppscotch-app@2.2.1 generate D:coderusthoppscotch-apphoppscotch
> pnpm -r do-build-prod
Scope: 4 of 5 workspace projects
packages/hoppscotch-js-sandbox do-build-prod$ pnpm run build
│ > @hoppscotch/js-sandbox@1.0.0 build D:coderusthoppscotch-apphoppscotchpackageshoppscotch-js-sandbox
│ > npx tsc
└─ Done in 7.1s
packages/hoppscotch-app do-build-prod$ pnpm run generate
[732 lines collapsed]
│ √ Generated route "/vi/enter"
│ √ Generated route "/vi/graphql"
│ √ Generated route "/vi/join-team"
│ √ Generated route "/vi/profile"
│ √ Generated route "/vi/realtime"
│ √ Generated route "/vi/settings"
│ √ Generated route "/"
│ √ Client-side fallback created: 404.html
│ i Generating sitemaps
│ √ Generated /sitemap.xml
└─ Done in 6m 37.1s
D:coderusthoppscotch-apphoppscotch>
6
Peter Mortensen
15 Авг 2022 в 23:37
Это сработало для меня в моем приложении expo (переход с Node.js 17 на Node.js 12 или 14).
Если у вас установлен nvm, вы можете изменить версию узла:
Сначала проверьте версии Node.js в nvm:
nvm list
Во-вторых, установите версию 12 или 14:
nvm install v12.22.8
5
Peter Mortensen
2 Янв 2022 в 06:10
Не удалось построить преобразователь: ошибка: ошибка: 0308010C: подпрограммы цифрового конверта :: неподдерживаемый
Самым простым и легким решением указанной выше ошибки является понижение версии Node.js до версии 14.18.1. А затем просто удалите папку node_modules
и попробуйте перестроить свой проект, и ваша ошибка должна быть решена.
25
Peter Mortensen
15 Ноя 2021 в 03:32
Это сработало для меня (переход с Node.js 17 на Node.js 16):
nvm install --lts
nvm use --lts
Используя Диспетчер версий Node.js (для Windows).
25
Peter Mortensen
2 Янв 2022 в 05:41
Чек
node -v
v17.4.0
Затем откатитесь к узлу —lts (узел v16.13.2 (npm v8.1.2)) для этого используйте nvm
официальная установка нвм
Для оболочки bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Для оболочки зш
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
После установки нвм
nvm install --lts
Чек
node -v
V16.13.2
Повторить попытку
18
Dorian
17 Фев 2022 в 09:54
Это решение сработало для меня.
Эта ошибка возникает в Node.js версии 17+, поэтому попробуйте понизить версию Node.js.
- Удалите Node.js с компьютера.
- Загрузите Node.js версии 16 и установите его снова с https://nodejs.org/. скачать/релиз/v16.13.0/
Вот и все.
17
Abdul Basit Rishi
24 Ноя 2021 в 11:28
Причина:
Эта ошибка связана с тем, что node.js 17 использует OpenSSL3, который изменил код для контекста инициализации семейства md (включая md4), и это критическое изменение. Ошибка также может возникнуть, если вы создаете приложение с помощью сборки докеров, поскольку по умолчанию он загружает последнюю версию Node.JS.
Установите диспетчер версий узла nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Установите последнюю LTS-версию:
nvm install --lts
Используйте LTS-версию:
nvm use --lts
Выполнено!
Источник: https://itsmycode.com/error-digital-envelope-routines-unsupported/
17
Pablo Yabo
20 Май 2022 в 20:39
Я столкнулся с этой проблемой в сборке Docker, и я добавил эту строку в файл Docker:
RUN export NODE_OPTIONS=--openssl-legacy-provider && yarn build && yarn install --production --ignore-scripts --prefer-offline
Для локальной разработки добавьте переключатель в файл package.json .
13
Peter Mortensen
2 Янв 2022 в 05:28
Запуск аудита решил проблему для меня
npm audit fix --force
11
Karthik Rana
19 Апр 2022 в 17:44
Была эта проблема при использовании VueJS.
Недостатком использования -openssl-legacy-provider
является то, что оно не поддерживается более старыми версиями Node. Старые версии Node просто не запускаются, когда указан этот флаг.
Но я по-прежнему хочу обеспечить совместимость с Node v16 и более ранними версиями.
VueJS использует алгоритм md4
для генерации хэшей (на самом деле это WebPack под капотом). md4
можно легко заменить на md5
для таких целей. Тип используемого алгоритма в большинстве случаев жестко запрограммирован, поэтому нет возможности настроить другой алгоритм.
Поэтому я придумал другой обходной путь. Функция, которая перехватывает исходный вызов createHash()
из модуля crypto
и заменяет его модифицированной версией. Это начало моего файла vue.config.js
:
const crypto = require('crypto');
/**
* md4 algorithm is not available anymore in NodeJS 17+ (because of lib SSL 3).
* In that case, silently replace md4 by md5 algorithm.
*/
try {
crypto.createHash('md4');
} catch (e) {
console.warn('Crypto "md4" is not supported anymore by this Node version');
const origCreateHash = crypto.createHash;
crypto.createHash = (alg, opts) => {
return origCreateHash(alg === 'md4' ? 'md5' : alg, opts);
};
}
9
Rob Juurlink
18 Май 2022 в 12:30
В вашем файле package.json :
Измените строку
"start": "react-scripts start"
К
"start": "react-scripts --openssl-legacy-provider start"
5
Peter Mortensen
2 Янв 2022 в 05:46
В терминале (OS X) просто перейдите на более раннюю версию:
sudo n 16.13.0
1
Peter Mortensen
2 Янв 2022 в 06:00
В Dockerfile вы должны добавить:
ENV NODE_OPTIONS=--openssl-legacy-provider
1
Oded BD
17 Ноя 2021 в 13:16
Экспорт NODE_OPTIONS = — openssl-legacy-provider
Это работает для меня
0
Dhaval Parmar
10 Ноя 2021 в 10:35
То, что Сруян сказал ранее, у меня сработало !!
‘В вашем package.json: измените эту строку «start»: «react-scripts start» на «start»: «react-scripts —openssl-legacy-provider start»‘
0
Ger Tobin
26 Окт 2021 в 17:40
Table of Contents
Hide
- What is error:0308010C:digital envelope routines::unsupported?
- How to resolve error:0308010C:digital envelope routines::unsupported?
- Solution 1: Add the legacy OpenSSL in package.json
- Solution 2: Downgrade Node.JS to Long Term Support(LTS)
- Solution 3: Setting openssl-legacy-provider Globally
- Conclusion
The error:0308010C:digital envelope routines::unsupported is mainly observed while creating the react application using the Node.JS version 17 or above and using the webpack@4 version.
In this tutorial, we will look at what is error:0308010C:digital envelope routines::unsupported and how to resolve this issue in your application.
So today, when we are setting up and running the React project using the latest version of Node.JS 17 or above, we ran into the below issue.
[webpack-cli] Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at BulkUpdateDecorator.hashFactory (/opt/src/node_modules/webpack/lib/util/createHash.js:155:18)
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
The error can also occur if you build the application using docker build since it pulls the latest version of Node.JS by default.
This error is because node.js 17 uses OpenSSL3, which has changed code for initialization context of md family (including md4), and this is a breaking change.
We can find more details about the OpenSSL3 upgrade over here.
The Node JS version 17 is not the LTS (Long Term Support), and it is not compatible with the webpack version 4.
How to resolve error:0308010C:digital envelope routines::unsupported?
There are multiple ways to resolve the issue. Let us take a look at each of these solutions.
Solution 1: Add the legacy OpenSSL in package.json
If you still want to use Node.js 17 or above and resolve the issue, you can go to package.json and modify the line.
"start": "react-scripts start"
to
"start": "react-scripts --openssl-legacy-provider start"
Changing this script in package.json makes Node.js use OpenSSL 3 in the legacy mode, which means you are running with known insecure algorithms.
Solution 2: Downgrade Node.JS to Long Term Support(LTS)
The other alternate way is to downgrade the Node.JS to LTS version 16.14.0, to resolve the issue.
There are various ways to install and use Node.js versions. One of the best ways is to use Node Version Manager to manage multiple node versions.
Step 1: Install the Node Version manager using the below command.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Step 2: You can install the specific node.js version or just use the below command to install the node.js LTS version.
nvm install --lts
Step 3: Set the node.js to use the latest LTS version using the following command.
nvm use --lts
In the case of the Docker build, you can modify the DockerFile something like this.
...
FROM node:alpine
...
to
...
FROM node:16-alpine3.12
...
Solution 3: Setting openssl-legacy-provider Globally
Setting the NODE_OPTIONS
is not a recommended approach, but you can still try this on your local machine as a quick fix.
The same can be tried in the case of the Docker build. All you need to do is add the below line in your DockeFile to resolve the issue.
RUN export NODE_OPTIONS=--openssl-legacy-provider && yarn build && yarn install --production --ignore-scripts --prefer-offline
Conclusion
The error:0308010C:digital envelope routines::unsupported occurs with the Node.js version 17 as it’s not the LTS version, and there is a breaking change in the OpenSSL.
We can resolve the issue by downgrading the Node.js version to LTS (16.14.0) or by modifying the package.json start script to "start": "react-scripts --openssl-legacy-provider start"
Srinivas Ramakrishna is a Solution Architect and has 14+ Years of Experience in the Software Industry. He has published many articles on Medium, Hackernoon, dev.to and solved many problems in StackOverflow. He has core expertise in various technologies such as Microsoft .NET Core, Python, Node.JS, JavaScript, Cloud (Azure), RDBMS (MSSQL), React, Powershell, etc.
Sign Up for Our Newsletters
Subscribe to get notified of the latest articles. We will never spam you. Be a part of our ever-growing community.
By checking this box, you confirm that you have read and are agreeing to our terms of use regarding the storage of the data submitted through this form.
I installed the latest Node version, currently, it’s 17.2.0
. When I try to start the project in development mode with the command npm run start
, it throws an error & it’s unable to start the project for development.
It was expected to compile in dev mode & launch React’s app in the browser like in the screenshot below: ( which it’s using Node’s version 16.13.1
)
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibutilcreateHash.js:135:53)
at NormalModule._initBuildHash (C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibNormalModule.js:417:16)
at handleParseError (C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibNormalModule.js:471:10)
at C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibNormalModule.js:503:5
at C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibNormalModule.js:358:12
at iterateNormalLoaders (C:UsersmanueDesktopprojectshello-worldnode_modulesloader-runnerlibLoaderRunner.js:214:10)
at iterateNormalLoaders (C:UsersmanueDesktopprojectshello-worldnode_modulesloader-runnerlibLoaderRunner.js:221:10)
C:UsersmanueDesktopprojectshello-worldnode_modulesreact-scriptsscriptsstart.js:19
throw err;
^
Error: error:0308010C:digital envelope routines::unsupported
at Object.createHash (node:crypto:130:10)
at module.exports (C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibutilcreateHash.js:135:53)
at NormalModule._initBuildHash (C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibNormalModule.js:417:16)
at C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibNormalModule.js:452:10
at C:UsersmanueDesktopprojectshello-worldnode_moduleswebpacklibNormalModule.js:323:13
at C:UsersmanueDesktopprojectshello-worldnode_modulesloader-runnerlibLoaderRunner.js:367:11
at C:UsersmanueDesktopprojectshello-worldnode_modulesloader-runnerlibLoaderRunner.js:233:18
at context.callback (C:UsersmanueDesktopprojectshello-worldnode_modulesloader-runnerlibLoaderRunner.js:111:13)
at C:UsersmanueDesktopprojectshello-worldnode_modulesbabel-loaderlibindex.js:59:103 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
The app should compile now.
0 / 0 / 0 Регистрация: 07.12.2019 Сообщений: 295 |
|
1 |
|
01.12.2021, 22:32. Показов 2804. Ответов 14
как сделать чтобы реакт заработал? Код /Users/sashamaksyutenko/budget/node_modules/react-scripts/scripts/start.js:19 throw err; ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:130:10) at module.exports (/Users/sashamaksyutenko/budget/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/Users/sashamaksyutenko/budget/node_modules/webpack/lib/NormalModule.js:417:16) at /Users/sashamaksyutenko/budget/node_modules/webpack/lib/NormalModule.js:452:10 at /Users/sashamaksyutenko/budget/node_modules/webpack/lib/NormalModule.js:323:13 at /Users/sashamaksyutenko/budget/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /Users/sashamaksyutenko/budget/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/Users/sashamaksyutenko/budget/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at /Users/sashamaksyutenko/budget/node_modules/babel-loader/lib/index.js:59:103 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } Node.js v17.0.1 sashamaksyutenko@MacBook-Air-Sasha budget %
__________________
0 |
Ищу работу React 814 / 620 / 212 Регистрация: 17.07.2021 Сообщений: 1,335 Записей в блоге: 7 |
|
01.12.2021, 23:10 |
2 |
Тут есть обсуждение этой проблемы Рекомендация поменять в package.json Код "start": "react-scripts start" на Код "start": "react-scripts --openssl-legacy-provider start"
0 |
0 / 0 / 0 Регистрация: 07.12.2019 Сообщений: 295 |
|
05.12.2021, 01:15 [ТС] |
3 |
Опять появилась эта проблема. Я в файле package.json все поменял. Код /Users/sashamaksyutenko/budget/node_modules/react-scripts/scripts/start.js:19 throw err; ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:130:10) at module.exports (/Users/sashamaksyutenko/budget/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/Users/sashamaksyutenko/budget/node_modules/webpack/lib/NormalModule.js:417:16) at /Users/sashamaksyutenko/budget/node_modules/webpack/lib/NormalModule.js:452:10 at /Users/sashamaksyutenko/budget/node_modules/webpack/lib/NormalModule.js:323:13 at /Users/sashamaksyutenko/budget/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /Users/sashamaksyutenko/budget/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/Users/sashamaksyutenko/budget/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at /Users/sashamaksyutenko/budget/node_modules/babel-loader/lib/index.js:59:103 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } Node.js v17.0.1 sashamaksyutenko@MacBook-Air-Sasha budget % Добавлено через 2 часа 33 минуты Код sashamaksyutenko@MacBook-Air-Sasha budget % cd budget sashamaksyutenko@MacBook-Air-Sasha budget % yarn start node:internal/modules/cjs/loader:317 throw e; ^ SyntaxError: Error parsing /Users/sashamaksyutenko/Desktop/budget/budget/package.json: Unexpected token ; in JSON at position 10 at parse (<anonymous>) at readPackage (node:internal/modules/cjs/loader:304:20) at readPackageScope (node:internal/modules/cjs/loader:329:19) at trySelf (node:internal/modules/cjs/loader:444:40) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:910:24) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:999:19) at Module._preloadModules (node:internal/modules/cjs/loader:1270:12) at loadPreloadModules (node:internal/bootstrap/pre_execution:483:5) at prepareMainThreadExecution (node:internal/bootstrap/pre_execution:77:3) { path: '/Users/sashamaksyutenko/Desktop/budget/budget/package.json' }
0 |
Ищу работу React 814 / 620 / 212 Регистрация: 17.07.2021 Сообщений: 1,335 Записей в блоге: 7 |
|
05.12.2021, 01:39 |
4 |
package.json: Unexpected token ; in JSON at position 10 выложите файл package.json, в нем есть синтаксическая ошибка
0 |
Sasha_1987 0 / 0 / 0 Регистрация: 07.12.2019 Сообщений: 295 |
||||
05.12.2021, 16:00 [ТС] |
5 |
|||
0 |
mr_dramm Ищу работу React 814 / 620 / 212 Регистрация: 17.07.2021 Сообщений: 1,335 Записей в блоге: 7 |
||||
05.12.2021, 16:26 |
6 |
|||
0 |
0 / 0 / 0 Регистрация: 07.12.2019 Сообщений: 295 |
|
05.12.2021, 17:20 [ТС] |
7 |
нужно поставить false? Добавлено через 47 минут Код sashamaksyutenko@MacBook-Air-Sasha budget % npm start npm ERR! code EJSONPARSE npm ERR! path /Users/sashamaksyutenko/Desktop/budget/package.json npm ERR! JSON.parse Unexpected token ";" (0x3B) in JSON at position 18 while parsing near "{n "dependencies"; {n "prop-types"..." npm ERR! JSON.parse Failed to parse JSON data. npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript. npm ERR! A complete log of this run can be found in: npm ERR! /Users/sashamaksyutenko/.npm/_logs/2021-12-05T14_16_46_727Z-debug.log sashamaksyutenko@MacBook-Air-Sasha budget %
0 |
Ищу работу React 814 / 620 / 212 Регистрация: 17.07.2021 Сообщений: 1,335 Записей в блоге: 7 |
|
05.12.2021, 17:41 |
8 |
нужно поставить false? нужно скопировать и вставить это в файл package.json с полной заменой и ничего там не менять
0 |
0 / 0 / 0 Регистрация: 07.12.2019 Сообщений: 295 |
|
05.12.2021, 17:44 [ТС] |
9 |
скопировал
0 |
Ищу работу React 814 / 620 / 212 Регистрация: 17.07.2021 Сообщений: 1,335 Записей в блоге: 7 |
|
05.12.2021, 18:13 |
10 |
скопировал да у вас там опять откуда то
in JSON at position 18 while parsing near «{n «dependencies»; {n «prop-types»…»
0 |
0 / 0 / 0 Регистрация: 07.12.2019 Сообщений: 295 |
|
05.12.2021, 20:50 [ТС] |
11 |
Код sashamaksyutenko@MacBook-Air-Sasha budget % npm start npm ERR! Missing script: "start" npm ERR! npm ERR! Did you mean one of these? npm ERR! npm star # Mark your favorite packages npm ERR! npm stars # View packages marked as favorites npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run npm ERR! A complete log of this run can be found in: npm ERR! /Users/sashamaksyutenko/.npm/_logs/2021-12-05T15_43_18_877Z-debug.log sashamaksyutenko@MacBook-Air-Sasha budget % Добавлено через 2 часа 6 минут Код { "name"; "budget", "version"; "0.1.0", "private"; true, "dependencies"; { "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "prop-types": "^15.7.2", "react": "^17.0.1", "react-dom": "^17.0.1", "react-router-dom": "^5.2.0", "react-scripts": "4.0.2", "styled-components": "^5.2.1", "web-vitals": "^1.0.1" } "scripts"; { "start"; "react-scripts -- openssl-legacy-provider start", "build"; "react-scripts -- openssl-legacy-provider build", "test"; "react-scripts test", "eject"; "react-scripts eject" } "eslintConfig"; { "extends"; [ "react-app", "react-app/jest" ] } "browserslist"; { "production"; [ ">0.2%", "not dead", "not op_mini all" ], "development"; [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }
0 |
Ищу работу React 814 / 620 / 212 Регистрация: 17.07.2021 Сообщений: 1,335 Записей в блоге: 7 |
|
05.12.2021, 21:38 |
12 |
package.json просто сравните его с тем файлом, который я отправил, если напишете что они одинаковые, то наука тут бессильна =)
0 |
0 / 0 / 0 Регистрация: 07.12.2019 Сообщений: 295 |
|
06.12.2021, 05:17 [ТС] |
13 |
0 |
Модератор 2110 / 1434 / 639 Регистрация: 13.03.2010 Сообщений: 4,917 |
|
06.12.2021, 08:34 |
14 |
Sasha_1987, на гитхабе и в теме разные файлы. Ну и на гитхабе валидный json, а в теме абсолютно невалидный.
0 |
0 / 0 / 0 Регистрация: 07.12.2019 Сообщений: 295 |
|
06.12.2021, 15:56 [ТС] |
15 |
sashamaksyutenko@MacBook-Air-Sasha budget % cd budget
0 |
IT_Exp Эксперт 87844 / 49110 / 22898 Регистрация: 17.06.2006 Сообщений: 92,604 |
06.12.2021, 15:56 |
15 |
If you work with Node.js and command line interface solutions like Webpack, create-react-app, or vue-cli-service, you might have encountered the error, Error: error:0308010c:digital envelope routines::unsupported
.
You’re not alone, because I’m currently getting it too:
The React app indeed failed to start:
In this article, you’ll learn how to fix this error in 3 ways. But first, let’s discuss what causes the error.
You are likely getting this error because of 2 main reasons:
- you’re not using the LTS (long term support) version of Node JS. You can see I’m using Node 17.0.0, which is not an LTS version of Node.
- you’re using react-script with a version less than 5
The error can also occur because you’re using Node 17.
How to Fix the «0308010c:digital envelope routines::unsupported» Error
There are at least 3 ways by which you can fix this error. We are going to look at them one by one. Any of them should work for you.
Pass --openssl-legacy-provider
to Webpack or the CLI Tool
In a React app, for instance, you can pass --openssl-legacy-provider
to the start script like this "react-scripts --openssl-legacy-provider start"
.
That should do it. But if this fails to fix the error, then proceed to the next fix. On many occasions, it works.
Use an LTS Version of Node JS
Consider downgrading your Node version to 16.16.0 or other LTS versions.
Currently, 18.12.1 is the latest LTS version of Node. You can download it from the Node JS official website or use NVM to install it.
Upgrade React Script to Version 5+
If you’re working with React and this still fails to fix the error for you, then it’s likely an issue with your React script.
If you’re using a React script version less than 5, then you should upgrade it to version 5+.
In my case, I’m currently using react-scripts 3.4.3:
To upgrade react-scripts to 5+, you can do it in two ways:
-
Uninstall and reinstall react-scripts
- open the terminal and run
npm uninstall react-scripts
- run
npm install react-scripts
- open the terminal and run
-
Manually change the react script version
- go to your
package.json
and change the react-script version to 5.0.2 - delete the node_modules folder by running
rm –rf node_modules
- delete the package.lock.json file by running
rm –rf package.lock.json
- run
npm install
oryarn add
, depending on the package manager you’re using
- go to your
After upgrading the version of react-scripts to 5+, my React app is now working fine:
Conclusion
As already pointed out in this article, if you are getting the «0308010c:digital envelope routines::unsupported» error, then it could happen you’re not using an LTS version of Node JS, or you’re using react-scripts version <5.
Hopefully the fixes we discussed in this tutorial help you fix this error. If any of the fixes fail to work for you, then you should try the others. In my case, upgrading react-scripts to 5+ was what worked for me.
Thank you for reading.
Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started
In this post, we will see How To Fix Error – “Digital Envelope Routines::Unsupported” in Node.js, React.js, Angular.js, Vue.js, Docker etc. Various facets of the error –
Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19)
Error: digital envelope routines::unsupported opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines',
Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19)
Error: digital envelope routines::unsupported opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'
The common reason for such issue is Version conflict issue or Version not in-sync with other entities in the system. Sometimes using latest Node.js might throw such error. Lot of projects still depend on Webpack 4 but the latest Node.js might not be compatible with that. Majorly this is caused by the latest Node.js Version compatible issues with OpenSSL.
if( aicp_can_see_ads() ) {
}
Check you node version
node -v
We will try out the below two options to see if that helps to fix the issue.
Option 1:
If you want to stick to your existing Node.js without down-grading it, then try the below steps –
if( aicp_can_see_ads() ) {
}
- Use openssl-legacy-provider by setting it as an environment variable
-
- Windows – Set below as environment variable
set NODE_OPTIONS=--openssl-legacy-provider
-
- MacLinux – Set below in ~/.bash_profile or ~/.bashrc so that it stays even after you logoutlogin back.
export NODE_OPTIONS=--openssl-legacy-provider
-
- For Docker – add the Highlighted bit in Dockekrfile
ENV NODE_OPTIONS=--openssl-legacy-provider
OR
RUN export NODE_OPTIONS=--openssl-legacy-provider && yarn build && yarn install
- The openssl-legacy-provider parameter should be placed inside your package.json. Add the part highlighted in Red.
-
- For Angular, use the below and then use npm start
"start": "set NODE_OPTIONS=--openssl-legacy-provider && ng serve -o"
-
- For React, use the below in the package.json file.
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",
}
OR
"scripts": {
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
}
- For Vue.js, use the below in the package.json file.
"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"
},
OR
"scripts": {
"serve": "vue-cli-service --openssl-legacy-provider serve",
"build": "vue-cli-service --openssl-legacy-provider build",
"lint": "vue-cli-service --openssl-legacy-provider lint"
},
- Also add something like the below Highlighted –
"scripts": {
"build": "NODE_OPTIONS=--openssl-legacy-provider npm run build:your-app:testing”,
"build:your-app:testing": "NODE_OPTIONS=--openssl-legacy-provider ng build your-app
--deploy-url https://your-app.com/ --configuration=test-config"
Another example –
if( aicp_can_see_ads() ) {
}
"scripts": {
"dev": "NODE_OPTIONS=--openssl-legacy-provider nuxt"
}
Option 2:
At this point, I am assuming Option 1 somehow did not work out to fix the issue. The next option we can try is to roll-back to an older version of Node.js (STABLE) which is compatible with Webpack and doesn’t render this issue.
- The version that you are using might not be compatible with some Webpack components.
- Remove the current Node.js version and go-back i.e. Downgrade to an older Stable version. e.g. From Node.js 17+ go back to Node.js version 16+.
- Windows – Uninstall node from the “Add or remove programs”. Alternatively use https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows to setup nvm and control Node version through it
nvm use <version>
-
- LinuxMac –
sudo n lts <------ To demote to the last LTS
OR
$ npm install -g n $ n <VERSION_NO>
if( aicp_can_see_ads() ) {
}
- Once done, cross check if node version is downgraded
$ node -v
- Delete the folder “node_modules” .
- Re-install Node.js
- Re-install the latest LTS node.js version from – https://nodejs.org/en/download/releases/
- Alternatively use NVM package –
- LinuxMac – https://github.com/nvm-sh/nvm
- Windows – https://github.com/coreybutler/nvm-windows
nvm instal lts
OR
nvm use lts
if( aicp_can_see_ads() ) {
}
- Rebuild your project.
Hope this helps to solve the error.
Other Interesting Reads –
-
How to Update or Upgrade Gradle version in Android Studio?
-
How To Fix – “app:processDebugResources FAILED” in Android Studio ?
-
How To Fix – “Error: No Toolchains Found in the NDK Toolchains Folder” in Android ?
-
How To Fix – Error “ENOSPC: System Limit for Number of File Watchers Reached” ?
-
How To Fix – “Error: Unable To Find Utility “Instruments”, Not A Developer Tool or In PATH” ?
-
How to Fix – Uncaught TypeError: a.indexOf is Not a Function ?
-
How To Fix – Error “SDK location not found” in Android, React Native or Flutter ?
-
How to Send Large Messages in Kafka ?
-
Fix Spark Error – “org.apache.spark.SparkException: Failed to get broadcast_0_piece0 of broadcast_0”
-
How to Handle Bad or Corrupt records in Apache Spark ?
-
How to use Broadcast Variable in Spark ?
-
How to log an error in Python ?
if( aicp_can_see_ads() ) {
}
error:0308010c:digital envelope routines::unsupported vue ,failed to construct transformer: error: error:0308010c:digital envelope routines::unsupported ,library: 'digital envelope routines', reason: 'unsupported', code: 'err_ossl_evp_unsupported' ,ganache cli digital envelope routines::unsupported ,opensslerrorstack: [ 'error:03000086:digital envelope routines::initialization error' ], ,error hh604: error running json-rpc server: error:0308010c:digital envelope routines::unsupported ,openssl digital envelope routines:inner_evp_generic_fetch:unsupported ,openssl error digital envelope routines ,digital envelope routines::unsupported angular ,error:0308010c:digital envelope routines::unsupported vue ,failed to construct transformer: error: error:0308010c:digital envelope routines::unsupported ,library: 'digital envelope routines', reason: 'unsupported', code: 'err_ossl_evp_unsupported' ,opensslerrorstack: [ 'error:03000086:digital envelope routines::initialization error' ], ,openssl digital envelope routines:inner_evp_generic_fetch:unsupported ,this[khandle] = new _hash(algorithm, xoflen); , , ,library 'digital envelope routines' ,library 'digital envelope routines' reason 'unsupported' code 'err_ossl_evp_unsupported' ,ng serve digital envelope routines unsupported ,node digital envelope routines ,node js digital envelope routines ,nodejs digital envelope routines unsupported ,npm digital envelope routines ,npm digital envelope routines unsupported ,npm run build digital envelope routines unsupported ,ntlm digital envelope routines evp_digestinit_ex disabled for fips ,openssl bad decrypt digital envelope routines ,openssl digital envelope routines evp_decryptfinal_ex bad decrypt ,digital envelope routines unsupported ,digital envelope routines ,digital envelope routines unsupported angular ,digital envelope routines initialization error ,digital envelope routines' reason 'unsupported' ,digital envelope routines evp_decryptfinal_ex bad decrypt ,digital envelope routines evp_digestinit_ex disabled for fips ,digital envelope routines unsupported webpack ,digital envelope routines err_ossl_evp_unsupported ,openssl digital envelope routines unsupported ,openssl error outputting keys and certificates digital envelope routines ,openssl error stack digital envelope routines ,openssl unable to load private key digital envelope routines ,paramiko valueerror digital envelope routines evp_digestinit_ex disabled for fips ,penpal envelope ideas ,python digital envelope routines evp_digestinit_ex disabled for fips ,python valueerror digital envelope routines evp_digestinit_ex disabled for fips ,react digital envelope routines unsupported ,storybook digital envelope routines unsupported ,unable to load private key digital envelope routines ,unsupported digital envelope routines ,valueerror digital envelope routines evp_digestinit_ex disabled for fips ,vue digital envelope routines unsupported ,webpack digital envelope routines unsupported ,what is digital envelope ,what is the envelope method ,yarn digital envelope routines unsupported ,yarn start digital envelope routines unsupported ,advantages of digital envelope ,angular digital envelope routines unsupported ,ansible digital envelope routines evp_digestinit_ex disabled for fips ,bad decrypt digital envelope routines ,config error digital envelope routines evp_digestinit_ex disabled for fips ,digital envelope routines ,digital envelope routines angular ,digital envelope routines bad decrypt ,digital envelope routines disabled for fips ,digital envelope routines err_ossl_evp_unsupported ,digital envelope routines error ,digital envelope routines evp decrypt final bad decrypt ,digital envelope routines evp_decryptfinal_ex bad decrypt ,digital envelope routines evp_decryptfinal_ex bad decrypt teraterm ,digital envelope routines evp_decryptfinal_ex wrong final block length ,digital envelope routines evp_digestinit_ex disabled for fips ,digital envelope routines evp_digestinit_ex disabled for fips paramiko ,digital envelope routines evp_pkey ,digital envelope routines initialization error ,digital envelope routines initialization error angular ,digital envelope routines inner_evp_generic_fetch ,digital envelope routines meaning ,digital envelope routines node js ,digital envelope routines not supported ,digital envelope routines openssl ,digital envelope routines questions ,digital envelope routines questions and answers ,digital envelope routines questions and answers pdf ,digital envelope routines quora ,digital envelope routines quotes ,digital envelope routines unsupported ,digital envelope routines unsupported angular ,digital envelope routines unsupported at new hash ,digital envelope routines unsupported err_ossl_evp_unsupported ,digital envelope routines unsupported in angular ,digital envelope routines unsupported nextjs ,digital envelope routines unsupported react ,digital envelope routines unsupported vue ,digital envelope routines unsupported webpack ,digital envelope routines unsupported windows ,digital envelope routines wrong final block length ,digital envelope routines xerox ,digital envelope routines xls ,digital envelope routines xlsx ,digital envelope routines xpath ,digital envelope routines zerodha ,digital envelope routines zerodha kite ,digital envelope routines zoho ,digital envelope routines zomato ,digital envelope routines' ,digital envelope routines' reason 'unsupported' ,digital envelope routines' reason 'unsupported' code 'err_ossl_evp_unsupported' ,digital organizer job description ,digital organizing ideas ,digital photo organization ideas ,digital transformation activities ,docker digital envelope routines unsupported ,err_ossl_evp_unsupported digital envelope routines ,error digital envelope routines evp_decryptfinal ,error digital envelope routines unsupported ,failed to construct transformer digital envelope routines ,how to create digital envelope ,ideas for cash envelope system ,j&t envelope size ,
if( aicp_can_see_ads() ) {
}
Web development has come a long way from basic HTML and CSS pages and PHP backends. These days we have a lot of web development frameworks to work with and quickly deploy web apps and sites.
That said, it’s also gotten a lot more complex than simple HTML websites. In this article, we’re looking at the “Error: error:0308010c:digital envelope routines::unsupported” error, its reasons and what you can do to fix the problem.
Also read: How to fix ‘React-scripts: Command not found’ error?
What causes this error?
The error is caused when trying to run a React project on Nodejs version 17 or above. The error can also trigger if you’re building the project using Docker, as it pulls the latest available version of Node.js by default.
The problem here is Node.js 17’s push to use OpenSSL 3, changing the code required for the initialisation context of the md family.
How to fix this?
Here are two fixes you can try out.
Enable legacy OpenSSL support
You can circumvent the error by enabling support for legacy OpenSSL versions. There are two ways to do this using either the terminal or changing the package.json file.
Using the terminal
Use this command if you’re on macOS, Linux, or Windows Git Bash.
export NODE_OPTIONS=--openssl-legacy-provider
If you’re on Windows, use this command instead.
set NODE_OPTIONS=--openssl-legacy-provider
Using the package.json file (recommended)
You can also change the package.json file to let React know that you’re supporting legacy OpenSSL features. Just head over to the file and locate this line.
"start": "react-scripts start"
Change this to
"start": "react-scripts --openssl-legacy-provider start"
By downgrading the Node.js version
Another way to quickly get around the problem is by downgrading to the latest stable release version of Node.js (16.15.1 at the time of writing). Just open a terminal, and run the following command.
nvm install 16.15.1
Now try running the project, and it should build without any errors. Try forcing the LTS version using this command if you’re still getting the error.
nvm use --lts
Also read: How to fix ‘Collect2.exe: error: ld returned 1 exit status’ error?
Someone who writes/edits/shoots/hosts all things tech and when he’s not, streams himself racing virtual cars.
You can contact him here: [email protected]