Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in Blockchain by (47.6k points)

I am trying to work on truffle-contract and web3 but I am facing the 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?

1 Answer

0 votes
by (106k points)
edited by

To solve the Module Not found Error you can try compiling and migrating the contract using the following command:

$ truffle compile

$ truffle migrate

Know how Blockchain works in depth by enrolling in Blockchain Course.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...