错误 HH604:运行 JSON-RPC 服务器时出错:错误:0308010C:数字信封例程::不支持

问题描述 投票:0回答:7

我正在 Linux 中设置安全帽。我首先使用这些命令设置了 React 应用程序。

npx create-react-app react-dapp

cd react-dapp 

然后我使用此命令安装了一些安全帽依赖项。

npm install ethers hardhat @nomiclabs/hardhat-waffle \
        ethereum-waffle chai \
        @nomiclabs/hardhat-ether

这一切都做得正确。 然后我创建了安全帽配置和设置。

npx hardhat 

然后我编辑了 hardhat.config.js 文件。 我有这个地方。

module.exports = {
solidity: "0.8.4",
paths: {                         
   artifacts: './src/artifacts',  
},
networks: {                 
  hardhat: {
   chainId: 1337                
 }

} }; 之后我创建了节点。

npx hardhat node 

我收到此错误:

错误 HH604:运行 JSON-RPC 服务器时出错:错误:0308010C:数字信封例程::不支持

linux api blockchain metamask hardhat
7个回答
27
投票

有同样的问题。使用 Node 17.x,它有一个更新的 openssl,这是一个重大更改。

这对我有用,因为我使用的是纱线。

export NODE_OPTIONS=--openssl-legacy-provider

您也可以尝试仅使用节点上的

--openssl-legacy-provider
开关。


9
投票

我能够使用 nvm 使用 lts 节点版本解决问题。

nvm install --lts
nvm use --lts

3
投票

我刚才遇到了这个问题,但是由于我有 nvm,所以我的廉价解决方案是暂时使用 Node v16。


1
投票

我在运行节点 18.10.0 时遇到同样的问题 并能够用 enter image description here

修复它

然后运行此命令“npm install --save-dev Hardhat”


0
投票

我也面临着同样的问题。但是,更新 package.json 文件对我有用。您必须更新“scripts/start”依赖项,如下图所示:

start:"export SET NODE_OPTIONS=--openssl-legacy-provider && npx hardhat node" 


0
投票

这对我有帮助: “npm 更新 --legacy-peer-deps”


0
投票

也遇到同样的问题

  • 已检查以上所有解决方案均无效
  • 使用 NODE v18 和 v20

        Error HH604: Error running JSON-RPC server: ERROR processing /home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/deploy/01-deploy-nft-marketplace.js:
    TypeError: Cannot read properties of undefined (reading 'length')
        at getFrom (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat-deploy/src/helpers.ts:1642:14)
        at _deploy (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat-deploy/src/helpers.ts:537:9)
        at _deployOne (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat-deploy/src/helpers.ts:934:16)
        at Object.module.exports [as func] (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/deploy/01-deploy-nft-marketplace.js:16:28)
        at DeploymentsManager.executeDeployScripts (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1220:22)
        at DeploymentsManager.runDeploy (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1053:5)
        at SimpleTaskDefinition.action (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat-deploy/src/index.ts:409:5)
        at Environment._runTaskDefinition (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat/src/internal/core/runtime-environment.ts:359:14)
        at Environment.run (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat/src/internal/core/runtime-environment.ts:192:14)
        at SimpleTaskDefinition.action (/home/macbook-m3-pro/web3/nft-marketplace/hardhat-nft-marketplace/node_modules/hardhat-deploy/src/index.ts:555:32)
    
    For more info go to https://hardhat.org/HH604 or run Hardhat with --show-stack-traces
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

© www.soinside.com 2019 - 2024. All rights reserved.