windows下truffle console启动控制台出错的解决

tech2022-08-30  110

不想启动内置的ganache控制台可以将文件truffle.js改成如下:

// Allows us to use ES6 in our migrations and tests. require('babel-register') module.exports = { networks: { development: { host: 'localhost', port: 8545, network_id: '*' // Match any network id } } }

主要就是改成development 启动控制台:truffle console

遇到的坑:

windows下直接使用此命令(前面+node)是不行的,貌似是因为版本更新。。。会报一下错误:

解决cnpm install babel-register

然后在项目上使用git bash输入truffle console命令启动。

奇迹:

最新回复(0)