简体   繁体   English

松露编译,松露测试或松露迁移不会显示任何控制台输出或异常。 它什么也没做

[英]truffle compile , truffle test or truffle migration does not show any console output or exception . It just do nothing

I am setting up truffle with my Ubuntu 18.04 LTS and VS Code, getting follwowing truffle quickstart 我正在使用我的Ubuntu 18.04 LTS和VS Code设置松露,开始松露快速入门

However, the truffle compile or truffle migrate or truffle test does not work. 但是,松露编译或松露迁移或松露测试不起作用。 Even it does not throw any exception. 即使它也不会引发任何异常。 Anybody faced the similar issue? 有人遇到过类似的问题吗?

truffle compile is not working. 松露编译不起作用。 When I run the command it simply returns even its not showing any error. 当我运行命令时,它只是返回,甚至没有显示任何错误。 truffle init is working properly so that truffle istallation is not an issue. 松露初始化工作正常,因此松露istallation不会成为问题。 But truffle compile and migrate commands having issue. 但是松露编译和迁移命令有问题。 How can I fix this on Ubuntu machine?? 如何在Ubuntu计算机上解决此问题?

Truffle v5.0.4 (core: 5.0.4) 松露v5.0.4(核心:5.0.4)

Solidity v0.5.0 (solc-js) Solidity v0.5.0(solc-js)

Node v8.10.0 节点v8.10.0

After burning two nights, I have realized that truffle 5.0.4 is not stable yet. 经过两个晚上的燃烧,我意识到松露5.0.4尚未稳定。 For which truffle compile, build or migrate does not function even it does not throw any exception. 对于松露的编译,构建或迁移,即使没有引发任何异常也无法正常工作。

I have uninstalled the truffle 5.0.4 and installed the Truffle v5.0.0-next.26 (core: 5.0.0-beta.2) and it starts working. 我已经卸载了松露5.0.4并安装了松露v5.0.0-next.26(核心:5.0.0-beta.2),它开始工作。

abdus@abdus-HP-EliteBook-8460p:~$ which truffle /usr/local/bin/truffle abdus@abdus-HP-EliteBook-8460p:~$ rm -r /usr/local/bin/truffle rm: cannot remove '/usr/local/bin/truffle': Permission denied abdus@abdus-HP-EliteBook-8460p:~$ sudo rm -r /usr/local/bin/truffle abdus@abdus-HP-EliteBook-8460p:~$ which truffle abdus@abdus-HP-EliteBook-8460p:~$ sudo npm uninstall -g truffle removed 91 packages in 3.35s abdus@abdus-HP-EliteBook-8460p:~$ truffle --version bash: /usr/local/bin/truffle: No such file or directory abdus@abdus-HP-EliteBook-8460p:~$ truffle --version bash: /usr/local/bin/truffle: No such file or directory abdus@abdus-HP-EliteBook-8460p:~$ sudo npm install -g truffle@5.0.0-next.26 /usr/local/bin/truffle -> /usr/local/lib/node_modules/truffle/build/cli.bundled.js abdus @ abdus-HP-EliteBook-8460p:〜$松露/ usr / local / bin / truffle abdus @ abdus-HP-EliteBook-8460p:〜$ rm -r / usr / local / bin / truffle rm:无法删除' / usr / local / bin / truffle':权限被拒绝abdus @ abdus-HP-EliteBook-8460p:〜$ sudo rm -r / usr / local / bin / truffle abdus @ abdus-HP-EliteBook-8460p:〜$其中松露abdus @ abdus-HP-EliteBook-8460p:〜$ sudo npm uninstall -g truffle在3.35s中删除了91个软件包abdus @ abdus-HP-EliteBook-8460p:〜$ truffle --version bash:/ usr / local / bin / truffle :没有这样的文件或目录abdus @ abdus-HP-EliteBook-8460p:〜$ truffle --version bash:/ usr / local / bin / truffle:没有这样的文件或目录abdus @ abdus-HP-EliteBook-8460p:〜$ sudo npm install -g truffle@5.0.0-next.26 / usr / local / bin / truffle-> /usr/local/lib/node_modules/truffle/build/cli.bundled.js

keccak@1.4.0 install /usr/local/lib/node_modules/truffle/node_modules/keccak npm run rebuild || keccak@1.4.0安装/ usr / local / lib / node_modules / truffle / node_modules / keccak npm运行重建|| echo "Keccak bindings compilation fail. Pure JS implementation will be used." “ echo” Keccak绑定编译失败。将使用纯JS实现。“

keccak@1.4.0 rebuild /usr/local/lib/node_modules/truffle/node_modules/keccak node-gyp rebuild keccak@1.4.0重建/ usr / local / lib / node_modules / truffle / node_modules / keccak node-gyp重建

gyp ERR! 糟糕! configure error gyp ERR! 配置错误gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/truffle/node_modules/keccak/build' gyp ERR! 堆栈错误:EACCES:权限被拒绝,mkdir'/ usr / local / lib / node_modules / truffle / node_modules / keccak / build'gyp错误! System Linux 4.15.0-45-generic gyp ERR! 系统Linux 4.15.0-45-通用gyp错误! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! 命令“ / usr / bin / node”“ /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js”“重建” gyp ERR! cwd /usr/local/lib/node_modules/truffle/node_modules/keccak gyp ERR! cwd / usr / local / lib / node_modules / truffle / node_modules / keccak gyp错误! node -v v8.10.0 gyp ERR! 节点-v v8.10.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! node-gyp -v v3.8.0 gyp错误! not ok npm ERR! 不好,npm ERR! code ELIFECYCLE npm ERR! 代码ELIFECYCLE npm ERR! errno 1 npm ERR! errno 1 npm错误! keccak@1.4.0 rebuild: node-gyp rebuild npm ERR! keccak@1.4.0重建: node-gyp rebuild gyp重建npm ERR! Exit status 1 npm ERR! 退出状态1 npm ERR! npm ERR! npm ERR! Failed at the keccak@1.4.0 rebuild script. keccak@1.4.0重建脚本失败。 npm ERR! npm ERR! This is probably not a problem with npm. npm可能不是问题。 There is likely additional logging output above. 上面可能还有其他日志记录输出。 Keccak bindings compilation fail. Keccak绑定编译失败。 Pure JS implementation will be used. 将使用纯JS实现。 + truffle@5.0.0-next.26 added 91 packages from 305 contributors in 30.464s abdus@abdus-HP-EliteBook-8460p:~$ sudo npm install -g truffle@5.0.0-next.26 /usr/local/bin/truffle -> /usr/local/lib/node_modules/truffle/build/cli.bundled.js + truffle@5.0.0-next.26 updated 1 package in 4.731s abdus@abdus-HP-EliteBook-8460p:~$ sudo npm install -g truffle@5.0.0-next.26 /usr/local/bin/truffle -> /usr/local/lib/node_modules/truffle/build/cli.bundled.js + truffle@5.0.0-next.26 updated 1 package in 4.075s abdus@abdus-HP-EliteBook-8460p:~/election$ truffle version Truffle v5.0.0-next.26 (core: 5.0.0-beta.2) Solidity v0.5.0 (solc-js) Node v8.10.0 abdus@abdus-HP-EliteBook-8460p:~/election$ truffle init + truffle@5.0.0-next.26在30.464s中从305个贡献者添加了91个软件包abdus @ abdus-HP-EliteBook-8460p:〜$ sudo npm install -g truffle@5.0.0-next.26 / usr / local / bin / truffle-> /usr/local/lib/node_modules/truffle/build/cli.bundled.js + truffle@5.0.0-next.26更新了4.731s中的1个软件包abdus @ abdus-HP-EliteBook-8460p:〜 $ sudo npm install -g truffle@5.0.0-next.26 / usr / local / bin / truffle-> /usr/local/lib/node_modules/truffle/build/cli.bundled.js + truffle@5.0.0- next.26在4.075s中更新了1个软件包abdus @ abdus-HP-EliteBook-8460p:〜/ election $松露版本Truffle v5.0.0-next.26(core:5.0.0-beta.2)Solidity v0.5.0(solc -js)节点v8.10.0 abdus @ abdus-HP-EliteBook-8460p:〜/ election $松露初始化

✔ Preparing to download ✔准备下载

✔ Downloading ✔下载

✔ Cleaning up temporary files ✔清理临时文件

✔ Setting up box ✔设置框

Unbox successful. 取消装箱成功。 Sweet! 甜!

Commands: 命令:

Compile: truffle compile Migrate: truffle migrate Test contracts: truffle test 编译:松露编译迁移:松露迁移测试合约:松露测试

abdus@abdus-HP-EliteBook-8460p:~/election$ truffle compile Compiling ./contracts/Migrations.sol... Writing artifacts to ./build/contracts abdus @ abdus-HP-EliteBook-8460p:〜/ election $松露编译编译./contracts/Migrations.sol ...将工件写入./build/contracts

abdus@abdus-HP-EliteBook-8460p:~/election$ truffle build No build configuration found. abdus @ abdus-HP-EliteBook-8460p:〜/ election $松露构建未找到构建配置。 Preparing to compile contracts. 准备编制合同。 abdus@abdus-HP-EliteBook-8460p:~/election$ truffle migrate ⚠️ Important ⚠️ If you're using an HDWalletProvider, it must be Web3 1.0 enabled or your migration will hang. abdus @ abdus-HP-EliteBook-8460p:〜/ election $松露迁移⚠️重要信息⚠️如果您使用的是HDWalletProvider,则必须启用Web3 1.0,否则迁移将挂起。 Try: npm install --save truffle-hdwallet-provider@web3-one 尝试:npm install --save truffle-hdwallet-provider @ web3-one

Starting migrations... 正在开始迁移...

Network name: 'ganache' Network id: 5777 Block gas limit: 6721975 网络名称:“ ganache”网络ID:5777限制气体使用限制:6721975

1_initial_migration.js 1_initial_migration.js

Deploying 'Migrations' 部署“迁移”


transaction hash: 0x393caf519758cb8baf13ee100d5a0a08e329674d77489888f61833aa83cdb5d9 Blocks: 0 Seconds: 0 contract address: 0xC2d9c21b93d3D29b9ac03697CAc058FdA432Ce98 account: 0xA0d939f21C2d714754EB7a3091545B5C423EE18E balance: 99.99430184 gas used: 284908 gas price: 20 gwei value sent: 0 ETH total cost: 0.00569816 ETH 交易哈希值:0x393caf519758cb8baf13ee100d5a0a08e329674d77489888f61833aa83cdb5d9块:0秒:0合同地址:0xC2d9c21b93d3D29b9ac03697CAc058FdA432Ce98帐户:0xA0d939f21C2d15E490价格:9284

Saving migration to chain. 避免迁移到连锁店。 Saving artifacts 保存工件


Total cost: 0.00569816 ETH 总成本:0.00569816 ETH

Summary 摘要

Total deployments: 1 Final cost: 0.00569816 ETH 部署总数:1最终成本:0.00569816 ETH

abdus@abdus-HP-EliteBook-8460p:~/election$ touch contracts/Election.sol abdus@abdus-HP-EliteBook-8460p:~/election$ truffle build No build configuration found. abdus @ abdus-HP-EliteBook-8460p:〜/ election $接触合同/Election.sol abdus @ abdus-HP-EliteBook-8460p:〜/ election $松露构建找不到构建配置。 Preparing to compile contracts. 准备编制合同。 Compiling ./contracts/Election.sol... Writing artifacts to ./build/contracts 编译./contracts/Election.sol ...将工件写入./build/contracts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM