Repository navigation
17.0.1 win10 x64 OpenSSL configuration error #40547
Description
Activity
- addedopensslIssues and PRs related to the OpenSSL dependency.Issues and PRs related to the OpenSSL dependency.
on Oct 21, 2021 Thank you for your report. But could you provide more info about the steps that reproduce the bug?
Same version, and for me it works ok, on Windows.
It seems there is a problem in your path. Or some configuration.
Can you execute this on powershell? cmd /c echo %PATH%
and also this? cmd /c echo %OPENSSL_CONF%Windows PowerShell Copyright (C) Microsoft Corporation. Tous droits réservés. Testez le nouveau système multiplateforme PowerShell https://aka.ms/pscore6 PS C:\Users\amela> cmd /c echo %PATH% C:\Python310\Scripts\;C:\Python310\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\src\flutter\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\PostgreSQL\13\bin;C:\Program Files (x86)\Incredibuild;C:\Users\amela\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\PuTTY\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\kubectl\;C:\Program Files (x86)\stripe;C:\Program Files\dotnet\;C:\Program Files (x86)\dotnet\;C:\Program Files\nodejs\;C:\Users\amela\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\amela\AppData\Local\Programs\Python\Python39\;C:\Users\amela\AppData\Local\Microsoft\WindowsApps;C:\Users\amela\AppData\Local\Programs\Microsoft VS Code\bin;C:\tools\dart-sdk\bin;C:\Users\amela\AppData\Roaming\Pub\Cache\bin;C:\Users\amela\AppData\Local\Pub\Cache\bin;C:\Users\amela\.dotnet\tools;C:\Users\amela\AppData\Roaming\npm PS C:\Users\amela> PS C:\Users\amela> PS C:\Users\amela> PS C:\Users\amela> cmd /c echo %OPENSSL_CONF% C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf PS C:\Users\amela>
ps: with lts all work fine
node v16.x uses openssl v1.1.1, node v17.x uses openssl v3,
So, perphaps openssl v3 can't work with a openssl 1.x config file.In a powershell, try to execute: $env:OPENSSL_CONF = ''
So, OPENSSL_CONF var will be empty (in that same powershell).
Then, execute: npm
It works?Reacted by Quentin Gruber, Henitz, Surendar Yama, James Dunstan, Alper Erdogan, Leopold, sherlook22, Johnathan, Orhan Gazi Kılıç, Federico Mothe and 30 moreReacted by JRuizQuaxar, Ammar Siddiqi, Felipe, Faiq Najib, Muhammad Ichsanul Fadhil, Sadashish Kumar Bhokta and A7medmasryReacted by Johnathan, Orhan Gazi Kılıç, Federico Mothe, ElenaEguez, Manoj Baishya, Andreas, Mark, jlin42, JRuizQuaxar, Josh Patsey and 1 moreReacted by Sadashish Kumar BhoktaReacted by JRuizQuaxar and Sadashish Kumar Bhoktait works but it was mainly to prevent that the installer has a problem / forgetfulness
Ok. So I think node v17 is ok.
The problem is with your environment that has an explicit OPENSSL_CONF. I have Postgres 11 in my machine but OPENSSL_CONF isn't defined. But perhaps there is another program that uses odbc and openssl to connect to Postgres. So, you can undefine that environment variable and look if all other programs work ok, or configure then specific program not using whole system OPENSSL_CONF.what I'm trying to say is that node v17 should not be affected by the configuration of another program (https://www.npmjs.com/package/postgres, or dbeaver)
this is I find a serious problem because either it works, or it does not work and if it does not work when we have just installed it is that there is a problem (unless there is a configuration to do that is explicitly described)
the "it's work on my computer" must not exist only the "it's work" must have to exist with an installer
All other programs will be affected if you have a OPENSSL_CONF global variable. Because node loads opensslv3 and openssl3 try to load his config from OPENSSL_CONF. So it is a problem of opensslv3, not really a problem of node.js.
In fact, the problem is not with the installer, the problem is later, when you try to run npm.
One solution is to undefine that global variable OPENSSL_CONF. Have you tried to undefine that global variable? All works fine?Note that I don't belong to node.js, I only express on my own.
Reacted by Adam MajerIn fact, I have postgres 14, and have tried to install psqlodbc 13 from https://www.postgresql.org/ftp/odbc/versions/msi/
and it doesn't install any openssl.cnf, not have created any OPENSSL_CONF.Your software is going to be affected by the variables in its environment.
OPENSSL_CONFis OpenSSL env variable. All software that uses OpenSSL will use this. So, if you want only your Postgres instance to have it defined, only define it for your Postgres instance and not other software.This is not a bug. It's a user misconfiguration.
I thought that this problem came from the installer because it is the only one that created this problem for me and for your information I had not created any openssl conf
but I think I know what the problem is and yes it does not come at all from here (this thing will have me bored until the end)
the uninstallation is incomplete and its installation poorly done ...Sorry for the inconvenience !
Reacted by Quentin Gruber and David NyPerhaps you don't created the OPENSSL_CONF, but some program have done it. It's not an impossible thing to do what people say to you. But you have to swim against the river. The world is not against you, you are against the rest of the world.
Reacted by i^2Reacted by natraj-ng-17587I installed postgreSQL14 -- It sets OPENSSL_CONF to C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf
so I get the same error with nodejs as mentioned in the topic of this issue
set OPENSSL_CONF= before using node fixes it
I guess the question is whether its helpful that both programs use the same environment variable
I ran into the same problem. If NPM doesn't need the variable to be set anyway, why is it completely breaking npm? This is not a case of misconfiguration, I also think it should be fixed or worked around by the NPM/Node team.
The workaround is as Er4twXz said,
set OPENSSL_CONF= before using node (or npm) fixes itI installed postgreSQL14 -- It sets OPENSSL_CONF to C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf
Please report this as an error to whoever builds the PostgreSQL 14 package. This is an error that they leak this config parameter to the system. It should only be set to whatever postgres applications require it and nothing else.
It's not a Node issue that postgres installer breaks your system. Not pointing fingers or anything 😺
I'll try. You're probably right about it being in the wrong place. However, I'm still curious why a system variable that doesn't seem to affect Node would completely break it.
I'll try. You're probably right about it being in the wrong place. However, I'm still curious why a system variable that doesn't seem to affect Node would completely break it.
It affects ALL software that use OpenSSL. Both Node and PostgreSQL link with OpenSSL. If you install something else that uses OpenSSL, it will get affected by this system variable setting as well
In Windows, If I set
set OPENSSL_CONF="C:\Program Files\Git\usr\ssl\openssl.cnf"orset OPENSSL_CONF=""
then node 17.1.0 doesn't start.But If I set
set OPENSSL_CONF=
It starts.You must look how to do the same on Linux.
Tryexport OPENSSL_CONF=''orexport OPENSSL_CONF=orunset OPENSSL_CONF
Perhaps the last option, the best.Workaround
Create a
mynodefile on the PATH (typeecho $PATHto see the PATH), and in that file this three lines:#!/bin/sh unset OPENSSL_CONF node $*Then you must do
chmod +x mynode, to be able to run mynode.
Then simply execute mynode. (If this file is not in your PATH, you can execute it doing ./mynode if it's in the working directory)So, this
./mynode -e "console.log('hello!')"should work.And you can do the same with npm, creating a file mynpm.
I don't have a Linux to try, but this is the idea.
Reacted by VicI also had the same problem but I do have postgres installed. Upon checking, I noticed that there was the OPENSSL_CONF environment variable. I just deleted it and it worked for me.
Reacted by Vansh Baghel- added a commit that references this issue
on May 11, 2022 Create a empty file named openssl.cnf in C:\Program Files\PostgreSQL\psqlODBC\etc\ this directory.
It resolve my problem after creating this empty configuration file in PostgreSQL ODBC.
Reacted by Johann Meza, andrey-piskunov, Ali Hassan and Dânison dos SantosReacted by trinh minh hieu and Dânison dos SantosReacted by trinh minh hieu and Dânison dos SantosReacted by trinh minh hieu, Ali Hassan and Dânison dos Santos@zaidraed It works~!!! Thank you.
I was very frustrated cause any of above, didn't work.
Finally got a solution from you. Thank you!!Reacted by i^2@zaidraed It works~!!! Thank you. ++
Same version, and for me it works ok, on Windows.
It seems there is a problem in your path. Or some configuration.
Can you execute this on powershell? cmd /c echo %PATH% and also this? cmd /c echo %OPENSSL_CONF%
I am getting a similar error as @mortifia had, but did not have a similar output to @nassau-t 's question. Similarly, the solutions that have been suggested did not work. Both npm and Node are installed. Do y'all have an idea on what I could try next? My output to @nassau-t 's question is below:
PS C:\Users\ethan> cmd /c echo %PATH% C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\HP\HP One Agent;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\ethan\AppData\Local\Programs\Python\Launcher\;C:\Users\ethan\AppData\Local\Microsoft\WindowsApps;C:\msys64\ucrt64\bin;C:\Users\ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts;C:\Program Files\Azure Data Studio\bin;C:\Users\ethan\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\ethan\AppData\Local\Programs\Python\Python312\Scripts;C:\Users\ethan\AppData\Roaming\npm PS C:\Users\ethan> cmd /c echo %OPENSSL_CONF% %OPENSSL_CONF%Try to set OPENSSL_CONF to some directory, and create there an empty openssl.cnf file.
Or look for openssl.conf file and rename it to .bad (perhaps it is on C:\windows\System32\OpenSSH)Thank you for the suggestion! It didn't end up working, as the error turned out to be with the version of npm that I was using instead of the OPENSSL_CONF. For anyone that runs into a similar issue when trying to use create-react-app, follow the following steps to solve the error:
- run npm i -g npm@latest
- run npm uninstall -g create-react-app
- run npx create-react-app@5.0.1 ds-web-app
Your web app should be built. If it isn't, check that 5.0.1 is the latest version of npm and check the following resources below:
Version
17.0.1
Platform
Microsoft Windows NT 10.0.19043.0 x64
Subsystem
No response
What steps will reproduce the bug?
npm
bug
How often does it reproduce? Is there a required condition?
just install
What is the expected behavior?
to work
What do you see instead?
No response
Additional information
powershell and vscode