September 6, 2018

openssl config failed: error:02001003 when building SharePoint Framework (SPFx) web part

Problem

When building SharePoint Framework (SPFx) web part, you get errors related to openssl, such as

openssl config failed: error:02001003:system library:fopen:No such process

openssl

Also, if you run commands such as “npn -v", you will get same warnings. Depending where you run the commands from, you get the error in PowerShell command line, or classic CMD prompt, or both.

These errors/warnings do not, however, break anything in usual development scenarions, so SharePoint Workbench (local and hosted) work fine.

Solution

Error is due to missing environment variable pointing to OpenSSL config file. You can find the config file from OpenSSL installation folder under bin folder, e.g., "C:\OpenSSL-Win64\bin\openssl.cfg".

For PowerShell (=if you run the commands in Visual Studio Code Terminal), run:

$Env:OPENSSL_CONF = "C:\OpenSSL-Win64\bin\openssl.cfg"

For CMD prompt, run:

SET OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg

However

I prefer instead just installing 32 bit version of OpenSSL and not having to worry about these things.

No comments:

Post a Comment