Truffle migration error test rpc is running

0 votes

I'm following a solidity tutorial right now and I'm currently encountering an error when I run truffle migrate. Also, testrpc is running in another terminal tab, so this issue is unrelated to the others on here.

I run truffle init and then add my HelloWorld.sol smart contract to the contracts folder.

pragma solidity ^0.4.11;

contract HelloWorld {
    uint public balance;

    function HelloWorld(){
        balance = 1000;
    }
}

I then run truffle compile and everything works fine

Compiling ./contracts/ConvertLib.sol... 

Compiling ./contracts/HelloWorld.sol... 

Compiling ./contracts/MetaCoin.sol...

Compiling ./contracts/Migrations.sol... 

Writing artifacts to ./build/contracts

I then added the following to my 2_deploy_contracts.js migration file

var HelloWorld = artifacts.require("./HelloWorld.sol");

module.exports = function(deployer) {
  deployer.deploy(HelloWorld);
};

However when I run truffle migrate I receive the following 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)

I've tried npm installing truffle-expect but that doesn't seem to work either

Oct 3, 2018 in Blockchain by digger
• 26,740 points
767 views

1 answer to this question.

0 votes

1) Run the following command:

npm install -g truffle-expect truffle-config web3

2) Run testrpc in another shell instance

3) Run truffle migrate in your truffle project directory

This should work.

answered Oct 3, 2018 by slayer
• 29,370 points

Related Questions In Blockchain

0 votes
1 answer

Ethereum "truffle server" gives error: TypeError: fsevents is not a constructor

Looks like you have files missing.  Try creating project with: truffle ...READ MORE

answered Nov 30, 2018 in Blockchain by Omkar
• 69,220 points
956 views
0 votes
1 answer

Error while running make command using Fabric 1.0.6

It's a known issue in go 1.9.4: https://github.com/golang/go/issues/23739 While ...READ MORE

answered Jun 27, 2018 in Blockchain by Perry
• 17,100 points
1,089 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,942 views
0 votes
1 answer

Solidity geth: Error encountered during contract execution [Bad instruction]

recipes is a dynamic storage array. You need ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 69,220 points
1,482 views
0 votes
2 answers

Why is network already up to date while trying to deploy a contract on truffle?

I guess you have ganache running already ...READ MORE

answered Apr 24, 2018 in Blockchain by Shashank
• 10,400 points
4,593 views
0 votes
1 answer

How can I deploy a HelloWorld contract on my testrpc network?

The problem lies in the command: truffle migrate Your truffle migrate command ...READ MORE

answered Apr 27, 2018 in Blockchain by Perry
• 17,100 points

edited Aug 10, 2018 by Omkar 2,885 views
0 votes
1 answer

Truffle tutorials "Error:recipient address is not a contract address"

It appears like you have already migrated ...READ MORE

answered Aug 8, 2018 in Blockchain by slayer
• 29,370 points
1,153 views
0 votes
1 answer

Error connecting due to rpc error

In the previous version, this problem was ...READ MORE

answered Jul 6, 2018 in Blockchain by slayer
• 29,370 points
819 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