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

0 votes

When I run 

truffle migrate

I get this error:

Error: No network specified. Cannot determine current network.

    at Object.detect (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/environment.js:31:1)

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/commands/migrate.js:91:1

    at finished (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-workflow-compile/index.js:53:1)

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/index.js:314:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/profiler.js:158:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:3888:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:473:1

    at replenish (/usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:1006:1)

    at iterateeCallback (/usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:995:1)

    at /usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:969:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:3885:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/profiler.js:154:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:1140:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:473:1

    at iteratorCallback (/usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:1064:1)

    at /usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:969:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/~/async/dist/async.js:1137:1

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-compile/profiler.js:133:1

    at FSReqWrap.oncomplete (fs.js:153:5)
Nov 30, 2018 in Blockchain by slayer
• 29,370 points
1,091 views

1 answer to this question.

0 votes

Make these entries in truffle.js file:

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*" // Match any network id
    }
  }
};
answered Nov 30, 2018 by Omkar
• 69,230 points

Related Questions In Blockchain

+1 vote
5 answers

How to solve "truffle: command not found" error in blockchain?

First try restarting the system and then ...READ MORE

answered Jul 16, 2018 in Blockchain by slayer
• 29,370 points
11,835 views
0 votes
1 answer

Not able to invoke a contract in Ethereum Private chain using geth

Hope this helps: contract mortal { /* ...READ MORE

answered Oct 22, 2018 in Blockchain by Omkar
• 69,230 points
916 views
+1 vote
2 answers

Not able to create new account in geth for private ethereum network

Looks like the account you are trying ...READ MORE

answered Dec 6, 2018 in Blockchain by Omkar
• 69,230 points
3,999 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,882 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,399 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,326 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,230 points
1,616 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