truffle create contract shows no network available error

0 votes

I am trying to create a contract using the following command

truffle create contract vote

But I am getting this error:

No network available. Use `truffle develop` or add network to truffle.js config.

I am just trying to create contract. My testrpc is running.  I dont know how to solve this. 

Dec 11, 2018 in Blockchain by slayer
• 29,350 points
885 views

1 answer to this question.

0 votes

In your truffle project directory, you have to set some properties related to network in truffle.js file. If you are using testrpc, by default it runs on port 8545 so you can add the following properties in the truffle.js file:

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*" // Match any network id
    }
  }
};

answered Dec 11, 2018 by Omkar
• 69,210 points

Related Questions In Blockchain

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,142 views
0 votes
1 answer

How to solve “error: no objects passed to create” Error?

It seems like a problem with the ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,740 points
7,320 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,350 points
875 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,691 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,232 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,450 points
1,143 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,210 points
921 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,210 points
1,436 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