gnxvw
gnxvw

Reputation: 454

How to use web3 in React?

In order to use web3 in react, I imported web3 like this,

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.

Could you give me any advise, please?

Upvotes: 0

Views: 611

Answers (1)

JoshPerry
JoshPerry

Reputation: 125

Make sure that it is added to your package.json and try an npm install or even delete node_modules and npm install.

Upvotes: 1

Related Questions