How to solve Module...
 
Notifications
Clear all

How to solve Module not found Error Can t resolve truffle-contract error in web3  

  RSS

Sathish Kumar
(@sathish)
Member Moderator
Joined: 4 months ago
Posts: 1203
30/03/2021 11:36 am  

I am trying to work on truffle-contract and web3 but I am facing problem when I execute the npm run dev command. The error is as follows:

ERROR in ./app/javascripts/app.js
Module not found: Error: Can't resolve 'truffle-contract' in 'C:\Users\edureka\Desktop\SID\ALSC\PROJECT\asset-lending\app\javascripts'
 @ ./app/javascripts/app.js 6:1-55
 @ multi (webpack)-dev-server/client? http://localhost:8080  ./app/javascripts/app.js

ERROR in ./app/javascripts/app.js
Module not found: Error: Can't resolve 'web3' in 'C:\Users\edureka\Desktop\SID\ALSC\PROJECT\asset-lending\app\javascripts'
 @ ./app/javascripts/app.js 5:1-39
 @ multi (webpack)-dev-server/client? http://localhost:8080  ./app/javascripts/app.js
webpack: Failed to compile.

How to solve this error?


Quote
Ganesh A
(@ganesh)
Noble Member
Joined: 4 months ago
Posts: 1170
30/03/2021 11:37 am  

Try compiling and migrating the contract:

$ truffle compile
$ truffle migrate

ReplyQuote
Share: