+1 vote
1 view
in Blockchain by (28.1k 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 (68.3k points)

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

$ truffle compile

$ truffle migrate

...