Truffle 出现 You are trying to run dockerized solc

问题堆栈


E:\workspace\KnowledgeManagement\BlockChain\Solidity\study\truffle>truffle complie

Compiling your contracts...
===========================
'docker' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�������ļ�
Error: You are trying to run dockerized solc, but docker is not installed.
    at Docker.errors (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\compilerSupplier\loadingStrategies\LoadingStrategy.js:66:1)
    at Docker.validateAndGetSolcVersion (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\compilerSupplier\loadingStrategies\Docker.js:78:1)
    at Docker.load (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\compilerSupplier\loadingStrategies\Docker.js:15:1)
    at CompilerSupplier.load (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\compilerSupplier\index.js:70:1)
    at loadParser (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\profiler\loadParser.js:15:29)
    at asyncFunction (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\profiler\index.js:23:1)
    at Object.required_sources (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\profiler\polycallbackify.js:14:1)
    at hasTargets (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\new\index.js:77:1)
    at new Promise ()
    at AsyncFunction.compile.with_dependencies (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\new\index.js:76:33)
    at compile.necessary (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\compile-solidity\new\index.js:56:1)
    at E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\workflow-compile\new\index.js:52:1
    at async Promise.all (index 0)
    at compile (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\workflow-compile\new\index.js:39:1)
    at Object.compile (E:\softInstall\nodejs\node_global\node_modules\truffle\build\webpack:\packages\workflow-compile\new\index.js:82:52)
Truffle v5.1.44 (core: 5.1.44)
Node v12.18.3

E:\workspace\KnowledgeManagement\BlockChain\Solidity\study\truffle>

出现原因
truffle-config.js 配置文件中

compilers: {
    solc: {
       // version: "0.5.1",    // Fetch exact version from solc-bin (default: truffle's version)
       // docker: true,        // Use "0.5.1" you've installed locally with docker (default: false)
       settings: {          // See the solidity docs for advice about optimization and evmVersion
        optimizer: {
          enabled: false,
          runs: 200
        },
        //evmVersion: "byzantium"
       }
    },
  },

需要将 docker 注释掉,或者为false

你可能感兴趣的:(区块链)