I face no problem while compiling the contract. But when I migrate it, I get below error:
Error: Cannot find module 'truffle-expect'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:85773:14)
at __webpack_require__ (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:21:30)
at Object.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:59914:15)
at __webpack_require__ (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:21:30)
at Object.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:201851:15)
at __webpack_require__ (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:21:30)
Smart Contract:
pragma solidity^0.4.11;
contract HelloWorld {
uint public balance;
function HelloWorld(){
balance = 1000;
}
}
2_deploy_contract.js
var HelloWorld = artifacts.require("./HelloWorld.sol");
module.exports = function(deployer) {
deployer.deploy(HelloWorld);
};