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,040 points
36 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 27,620 points
0 votes

Simple Solution:

// module.exports = {
//   // See <http://truffleframework.com/docs/advanced/configuration>
//   // 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
• 66,880 points
49 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
• 66,880 points
65 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 29, 2018 in Blockchain by Omkar
• 66,880 points
83 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
79 views
0 votes
1 answer
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
• 66,880 points
40 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
• 66,880 points
156 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.