Azure Blockchain: Build Contracts Command in VS code gives an error

289 Views Asked by At

I am trying to start blockchains with azure , using its workbench and other resources . I have installed all the prerequisites and did not have problem with installing blockchains service to create consortium , and did not have and problem building the project , I am getting a problem building smart contracts with the command - 'Azure Blockchain: Build Contracts' in vs code terminal , below is the given error.

VS code told me to install .NET CLI which i did, later on, can some one tell how to check whether my project has been built completely.

a link to github!

I have tried installing the packages using npm but I am having error with that also.I am not aware if installing truffle as a prerequisites withouth npm does installs all the files required to build a azure solidity project, as I was having problem installing truffle with npm

Azure Blockchain: Build Contracts

This is the error message I am getting.

Get version for required apps
[Execute command] 
Working dir: c:\BlockChains\CodeFunDo
Running command
npx truffle compile
[Execute command] Error: Cannot find module 'truffle-hdwallet-provider'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (c:\BlockChains\CodeFunDo\truffle-config.js:1:26)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Function.Config.load (C:\Users\KAUSTUBH JHA\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-config\index.js:386:1)
    at Function.Config.detect (C:\Users\KAUSTUBH JHA\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-config\index.js:375:1)
    at Object.run (C:\Users\KAUSTUBH JHA\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\lib\commands\compile.js:56:1)
    at Command.run (C:\Users\KAUSTUBH JHA\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\lib\command.js:140:1)
    at Object.<anonymous> (C:\Users\KAUSTUBH JHA\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\cli.js:52:1)
    at __webpack_require__ (C:\Users\KAUSTUBH JHA\AppData\Roaming\npm\node_modules\truffle\build\webpack:\webpack\bootstrap 4290d8a3f36a864c3a92:19:1)
    at C:\Users\KAUSTUBH JHA\AppData\Roaming\npm\node_modules\truffle\build\webpack:\webpack\bootstrap 4290d8a3f36a864c3a92:65:1
    at Object.<anonymous> (C:\Users\KAUSTUBH JHA\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:71:10)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at findNodeScript.then.existing (C:\Program Files\nodejs\node_modules\npm\node_modules\libnpx\index.js:268:14)
[Execute command] Truffle v5.0.26 (core: 5.0.26)
[Execute command] Node v10.16.0
[Execute command] Finished running command
1

There are 1 best solutions below

0
On

This is happening because you are missing a node package. I also ran into the same problem.

Solution --

npm install -g hdwallet-provider

after this restart VS Code and try Building it will build...