我正在 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:数字信封例程::不支持
有同样的问题。使用 Node 17.x,它有一个更新的 openssl,这是一个重大更改。
这对我有用,因为我使用的是纱线。
export NODE_OPTIONS=--openssl-legacy-provider
您也可以尝试仅使用节点上的
--openssl-legacy-provider
开关。
我能够使用 nvm 使用 lts 节点版本解决问题。
nvm install --lts
nvm use --lts
我刚才遇到了这个问题,但是由于我有 nvm,所以我的廉价解决方案是暂时使用 Node v16。
这对我有帮助: “npm 更新 --legacy-peer-deps”
也遇到同样的问题
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.