簡體   English   中英

Npm 不工作(openSSL 配置錯誤 windows10x64)

[英]Npm not working (openSSL configuration error windows10x64)

每當我在 powershell 中嘗試 npm 命令時,我都會收到此錯誤:

**~ $ node -v
v17.1.0
~ $ npm -v
OpenSSL configuration error:
74240000:error:80000003:system library:BIO_new_file:No such process:c:\ws\deps\openssl\openssl\crypto\bio\bss_file.c:67:calling fopen(C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf, rb)
74240000:error:10000080:BIO routines:BIO_new_file:no such file:c:\ws\deps\openssl\openssl\crypto\bio\bss_file.c:75:
74240000:error:07000072:configuration file routines:def_load:no such file:c:\ws\deps\openssl\openssl\crypto\conf\conf_def.c:179:
OpenSSL configuration error:
A8250000:error:80000003:system library:BIO_new_file:No such process:c:\ws\deps\openssl\openssl\crypto\bio\bss_file.c:67:calling fopen(C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf, rb)
A8250000:error:10000080:BIO routines:BIO_new_file:no such file:c:\ws\deps\openssl\openssl\crypto\bio\bss_file.c:75:
A8250000:error:07000072:configuration file routines:def_load:no such file:c:\ws\deps\openssl\openssl\crypto\conf\conf_def.c:179:**

我注意到的另一件事是節點一定更新不正確,因為即使它給了我一個版本,我也無法卸載它,也無法在我的程序文件中找到安裝文件。 我完全不知所措,即將將我的計算機重置為默認值。 我想修復它,但網上的一切都告訴我使用 npm,這本身是不可能的。

我曾嘗試使用“set OpenSSL”命令清空文件或虛擬文件,但它似乎沒有做任何事情。

Go to the Windows control panel and click on Uninstall a program, select Node.js and click on the uninstall tab to uninstall the node and npm successfully. 重新啟動系統。 然后 go 到https://nodejs.org/en/下載 16.13.0 LTS 版本並安裝

請使用 PowerShell 檢查環境路徑

檢查環境路徑:

cmd /c echo %PATH%' or 'cmd /c echo %OPENSSL_CONF%

您將獲得C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf路徑,因此請使用openssl的以下注釋重置 openssl 的環境路徑

set OPENSSL_CONF=''

之后,問題將得到解決。

此問題已在 Nodejs GitHub 上發布。 https://github.com/nodejs/node/issues/40547

您唯一要做的就是在此路徑中創建一個名為openssl.cnf的新存檔:

C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf

保存工作並在 cmd 中運行: npm --version

我現在正在經歷同樣的問題。 找不到任何解決方案

在 conda 環境中遇到此問題。 通過使用下一個命令安裝節點來修復: conda install -c conda-forge nodejs=16.3.2

嘗試從項目目錄中卸載節點。

npm uninstall node

很可能您的系統上安裝了 2 個不同版本的 Node。

如果我的解決方案不適合你。 嘗試從系統中卸載 Node 的其他建議。

我的解決方案是在這種情況下使用另一個節點版本 15.8.0,您可以嘗試使用其他最新版本。 當我這樣做時 npm 安裝正確:

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM