[英]How to use web3 in React?
In order to use web3 in react, I imported web3 like this, 为了在反应中使用web3,我像这样导入了web3,
import Web3 from 'web3';
However, I got this error. 但是,我得到了这个错误。
Module not found: Can't resolve 'web3' in '/Users/___/Desktop/MyApps/eth_todo_react/frontend/src'
I used to use web3, but the error come up from yesterday. 我曾经使用过web3,但是错误从昨天开始出现。
Could you give me any advise, please? 请给我任何建议吗?
确保将其添加到package.json并尝试进行npm install
,甚至删除node_modules和npm install
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.