gpt4 book ai didi

node.js - `babel-runtime/core-js/object/entries` 发生在 `truffle test` 时

转载 作者:行者123 更新时间:2023-12-01 23:00:13 25 4
gpt4 key购买 nike

谁能帮我解决松露测试的这个问题?

这是我的环境:

Truffle v5.5.12 (core: 5.5.12)
Ganache v^7.1.0
Solidity - 0.8.13 (solc-js)
Node v17.9.0
Web3.js v1.5.3

这个错误 Cannot find module 'babel-runtime/core-js/object/entries' 发生在我 truffle test

Using network 'development'.

Error: Cannot find module 'babel-runtime/core-js/object/entries'
Require stack:
- /home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/index.js
- /home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/@truffle/debugger/dist/debugger.js
- /home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/build/cli.bundled.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/external "babel-runtime/core-js/object/entries":1:1)
at __webpack_require__ (/home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/webpack/bootstrap e958f07978aa008e523d:19:1)
at Object.<anonymous> (/home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/index.js:87:16)
at __webpack_require__ (/home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/webpack/bootstrap e958f07978aa008e523d:19:1)
at /home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/webpack/bootstrap e958f07978aa008e523d:62:1
at /home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/index.js:76:10
at webpackUniversalModuleDefinition (/home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/webpack/universalModuleDefinition:3:1)
at Object.<anonymous> (/home/jh/.nvm/versions/node/v17.9.0/lib/node_modules/truffle/node_modules/reselect-tree/webpack/universalModuleDefinition:10:1)
at Module._compile (node:internal/modules/cjs/loader:1099:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
Truffle v5.5.12 (core: 5.5.12)
Node v17.9.0

最佳答案

我遇到了同样的问题,这很可能是由 reselect-tree 的最新更新引起的。如果您将它的版本强制设置为 1.3.5,它就可以工作。

可以在项目本地安装truffle,在package.json中添加如下内容:

"overrides": {
"reselect-tree": "1.3.5"
}

然后重新安装包并使用 npx(或 yarn)运行 truffle:npx truffle testyarn truffle test

关于node.js - `babel-runtime/core-js/object/entries` 发生在 `truffle test` 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72096082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com