0

我正在尝试使用 azure 的工作台和其他资源来启动区块链。我已经安装了所有先决条件,并且在安装区块链服务以创建联盟时没有问题,并且在构建项目时没有问题,我在使用命令构建智能合约时遇到问题 - 'Azure Blockchain: Build Contracts' in vs代码终端,下面是给定的错误。

VS 代码告诉我安装 .NET CLI,我稍后会告诉我如何检查我的项目是否已完全构建。

一个到 github 的链接

我曾尝试使用 npm 安装软件包,但我也遇到了错误。我不知道是否将 truffle 作为先决条件安装 npm 是否会安装构建 azure solidity 项目所需的所有文件,因为我在安装 truffle 时遇到问题npm

Azure Blockchain: Build Contracts

这是我收到的错误消息。

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
4

1 回答 1

0

发生这种情况是因为您缺少一个节点包。我也遇到了同样的问题。

解决方案 -

npm install -g hdwallet-provider

在此重新启动 VS Code 并尝试构建后,它将构建...

于 2019-08-15T20:04:11.627 回答