简体   繁体   中英

Truffle migrate is not deploying to Ganache

I tried command truffle migrate --reset, but it is unable to connect to Ganche here is the error:在此处输入图像描述

This is the code inside truufle-config.js file:在此处输入图像描述

And these are the RPC server details:在此处输入图像描述

It seems there is a typo in your truffle-config.js : post instead of port .

Try this out:

  networks: {
    development: {
      host: "127.0.0.1",
      port: 9545,
      network_id: "*"
    }
  },

Then:

  • Double check the settings on Ganache match with the ones on truffle-config.js
  • Check that Ganache is running.

And finally open a new terminal and run the following 2 commands in the same folder where the file truffle-config.js is hosted :

truffle console ––network development

migrate ––reset

Try this out:

networks: {
    development: {
     host: "127.0.0.1",     
     port: 7545,            
     network_id: "*",       
    }
},

Open the terminal and run the following command in the same folder where the file truffle-config.js is hosted:

truffle console ––network development

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM