node.js - 未找到 ganache-cli 子进程依赖项
问题描述
我正在尝试在令牌向导应用程序中使用 ganache 和 web3.js。
我在终端中运行了一个 ganache-cli 实例,然后使用 ganache 作为提供程序使用以下代码创建了一个 web3.js 实例:
try {
window.web3 = new Web3(window.web3.currentProvider)
this.setState({
approvePermissions: true,
web3: window.web3
})
} catch (err) {
console.log('There was a problem fetching accounts', err)
}
当我启动我的应用程序时,我收到以下错误:
Error in ganache-cli
Module not found: Error: Can't resolve 'child_process' in 'C:\Users\name\Desktop\wiz\node_modules\ganache-cli\build'
任何人有想法解决它?
解决方案
推荐阅读
- google-apps-script - 如何在大查询应用程序脚本中使用自动检测模式将字符串类型列加载为大查询表中的标题?
- python - Sphinx 找不到我的项目的根模块
- if-statement - 如何计算以逗号分隔的列表中的文本?
- python - Json 响应 pyodbc 更好的方式
- google-chrome - 谷歌浏览器是否仅根据用户 ID 保存密码?
- javascript - 如何将事件侦听器附加到文档/窗口并确保 event.target 是文档
- java - 使用二叉搜索树数据在java中递归构建字符串
- javascript - 无法使用带点的计算属性值 - 无法设置为字符串 - JS
- python - Python:为什么类的新实例假定第一个实例的属性?
- python - 如何在 Python 中进行特定的可视化