简体   繁体   中英

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

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. But truffle compile and migrate commands having issue. How can I fix this on Ubuntu machine??

Truffle v5.0.4 (core: 5.0.4)

Solidity v0.5.0 (solc-js)

Node v8.10.0

After burning two nights, I have realized that truffle 5.0.4 is not stable yet. 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.

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

keccak@1.4.0 install /usr/local/lib/node_modules/truffle/node_modules/keccak npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."

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

gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/truffle/node_modules/keccak/build' gyp ERR! System Linux 4.15.0-45-generic gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/truffle/node_modules/keccak gyp ERR! node -v v8.10.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! keccak@1.4.0 rebuild: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the keccak@1.4.0 rebuild script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. Keccak bindings compilation fail. Pure JS implementation will be used. + 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

✔ 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$ truffle build No build configuration found. 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. Try: npm install --save truffle-hdwallet-provider@web3-one

Starting migrations...

Network name: 'ganache' Network id: 5777 Block gas limit: 6721975

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

Saving migration to chain. Saving artifacts


Total cost: 0.00569816 ETH

Summary

Total deployments: 1 Final cost: 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. Preparing to compile contracts. Compiling ./contracts/Election.sol... Writing artifacts to ./build/contracts

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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