Truffle migrate Error after run testrpc

0 votes

I can´t migrate the standart contracts that come with truffle compile. Here´s what i do:

truffle init
truffle compile
open other terminal and run testrpc
truffle migrate

and the first three step is smooth operation,but when i run truffle migrate ,it appears

Error: No network specified. Cannot determine current network.
    at Object.detect (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:43157:23)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:200497:19
    at finished (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:43085:9)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:198408:14
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:68162:7
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:163793:9
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:160353:16
    at replenish (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:160873:25)
    at iterateeCallback (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:160863:17)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:160838:16

My version list:

node 9.1.0
truffle 4.0.1
testrpc 6.0.3
Sep 24, 2018 in Blockchain by slayer
• 29,370 points
827 views

2 answers to this question.

0 votes

You should specify the network in the configuration file truffle.js, which is located in the root of your project folder.

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*" // Match any network id
    }
  }
};
answered Sep 24, 2018 by digger
• 26,740 points
0 votes

Simple Solution:

// module.exports = {

//   // to customize your Truffle configuration!
// };

So, you have to change it like below in truffle.js

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545, // your rpc port (like geth rpc port or testrpc port )
      network_id: "*"    
    }
  }
};
answered Sep 24, 2018 by Wasim

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer

Not able to migrate truffle project even after running testrpc

Maybe you forgot to compile the project ...READ MORE

answered Dec 11, 2018 in Blockchain by Omkar
• 69,220 points
857 views
0 votes
1 answer

truffle migrate Error

testrpc Check your truffle.js config port and ip ...READ MORE

answered Oct 8, 2018 in Blockchain by Omkar
• 69,220 points
1,296 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,180 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,923 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,451 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,464 views
0 votes
2 answers

Truffle migrate gives “ Error: No network specified. ”

You have to mention on which network ...READ MORE

answered Aug 13, 2018 in Blockchain by Omkar
• 69,220 points
1,710 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