npm install openssl failed on windows 10

别来无恙 提交于 2019-12-06 03:19:51

As mentionned by Royi Mindel the npm openssl package is just a wrapper around the openssl binaries and not the actual openssl. You need to install openssl on your Windows 10 machine as follows:

  1. Download the binaries from https://code.google.com/archive/p/openssl-for-windows/downloads
  2. Extract to C:\OpenSSL-Win32\ (or whatever name you want to give it).
  3. Add the system environment variable OPENSSL_CONF with value c:\OpenSSL-Win32\openssl.cnf (points to the config file where you extrated the binaries)
  4. Add C:\OpenSSL-Win32\bin to your Path environment variable
  5. Open a cmd or PowerShell and type openssl version. It should work and you should see the version installed

Info taken from: https://www.tbs-certificates.co.uk/FAQ/en/openssl-windows.html

By looking at the commands you are running, it seems like you are trying to use the installed npm module as an external command. You can achieve this only by installing the module globally:

npm install -g openssl

The warnings you get are expected. Each time you install a module locally, npm will try to update your package.json with the dependency to the module. Since you probably don't have a package.json in your home directory, you get the warning.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!