如何在 React 中使用 web3?
How to use web3 in React?
为了在react中使用web3,我是这样导入web3的,
import Web3 from 'web3';
但是,我得到了这个错误。
Module not found: Can't resolve 'web3' in '/Users/___/Desktop/MyApps/eth_todo_react/frontend/src'
我以前用的是web3,但是昨天出现的错误。
请问有什么建议吗?
确保它已添加到您的 package.json 并尝试 npm install
甚至删除 node_modules 和 npm install
.
为了在react中使用web3,我是这样导入web3的,
import Web3 from 'web3';
但是,我得到了这个错误。
Module not found: Can't resolve 'web3' in '/Users/___/Desktop/MyApps/eth_todo_react/frontend/src'
我以前用的是web3,但是昨天出现的错误。
请问有什么建议吗?
确保它已添加到您的 package.json 并尝试 npm install
甚至删除 node_modules 和 npm install
.