2

当我运行npm run dev它给我这个错误的命令时,我尝试了几次安装各种版本的web3 和松露合同,但它每次都给我同样的错误。

确切的错误:

ERROR in ./app/javascripts/app.js
Module not found: Error: Can't resolve 'truffle-contract' in 'C:\Users\Siddharth\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\Siddharth\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.
4

1 回答 1

1

npm install tr​​uffle-contract 它解决了这两个错误,如果它不起作用尝试全局安装,在我的情况下我安装在本地。

https://www.npmjs.com/package/truffle-contract

于 2017-12-20T07:42:35.737 回答