Truffle migrate shows Error Cannot find module truffle-expect

–1 vote

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);
};
Jan 18, 2019 in Blockchain by digger
• 26,740 points

edited Jan 18, 2019 by digger 990 views

2 answers to this question.

0 votes

As mentioned in the error: truffle-expect is missing. Install this:

npm install -g truffle-expect truffle-config web3

Now start testrpc on another terminal and then try migrating.

answered Jan 18, 2019 by Omkar
• 69,220 points
0 votes

You can also install the basic truffle-expect using the following command:

$ ​npm install -g truffle-expect
answered Feb 19, 2019 by Rohit

Related Questions In Blockchain

0 votes
4 answers

Hyperledger fabric: enrollAdmin.js Error: Cannot find module 'fabric-client'

Change your directory to fabric-samples/fabrcar. And run: npm ...READ MORE

answered Nov 21, 2018 in Blockchain by Omkar
• 69,220 points
5,213 views
0 votes
1 answer

Not able to migrate contract in Truffle: Error: No network specified. Cannot determine current network

Make these entries in truffle.js file: module.exports = { ...READ MORE

answered Nov 30, 2018 in Blockchain by Omkar
• 69,220 points
1,170 views
0 votes
2 answers

Truffle compile: Cant find module error

You can install babel-register and try again. ...READ MORE

answered Feb 19, 2019 in Blockchain by Loki
3,014 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,916 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,446 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,417 views
0 votes
1 answer

truffle migrate Error: “Cannot find module 'truffle-expect'”

Seems like you are missing some modules ...READ MORE

answered Jan 24, 2019 in Blockchain by Omkar
• 69,220 points
1,252 views
0 votes
1 answer

Truffle init: Error: Cannot find module 'original-require'

I think you need to run this ...READ MORE

answered Oct 24, 2018 in Blockchain by Omkar
• 69,220 points
1,915 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP