1、truffle migrate
Error: No network specified. Cannot determine current network.
解决方案:
导致上面异常的原因为是因为truffle.js里面未配置链接合约发布的环境地址,找到对应的truffle.js文件,修改代码为类似如下配置即可解决问题:
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
networks:{
development:{
host: "localhost",
port: 8545,//执行testrpc之后的端口
network_id: "*" //匹配任何
}
}
};
2、truffle serve
TypeError: fsevents is not a constructor
解决方案:truffle版本太高,可以更换3.2.1版本
npm uninstall -g truffle
npm install -g truffle@3.2.1
查看当前truffle的版本truffle version
如果在安装3.2.1版本时提示Python版本过高,请切换Python版本>= v2.5.0 & < 3.0.0.