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,050 points
58 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
• 67,200 points

Related Questions In Blockchain

0 votes
2 answers
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
• 27,620 points
118 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,050 points
177 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
107 views
0 votes
1 answer
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,320 points
56 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
• 67,200 points
97 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
• 67,200 points
172 views