以太坊truffle框架-错误记录

当在电脑需要走代理的情况下使用`truffle init`时,会遇到错误。可以使用`git clone`命令替代来初始化Truffle项目。在部署智能合约到test环境时,若未正确配置,会遇到异常,这通常是因为`truffle.js`中缺少环境地址配置。通过编辑`truffle.js`或`truffle-config.js`文件并添加相应环境配置,能解决编译合约时的问题。
摘要由CSDN通过智能技术生成

truffle init

Error: Example 'default' doesn't exist. If you believe this is an error, please contact Truffle support.
    at ClientRequest.<anonymous> (/usr/lib/node_modules/truffle/build/cli.bundled.js:214190:27)

1.如果电脑需要走代理,那么truffle init出现如下错误:

D:\gopath\simple-storage>truffle initDownloading…Error: Truffle Box
at URL https://github.com/truffle-box/bare-box.git doesn’t exist. If
you believe this is an error, please contact Truffle support.

解决方法可以是直接git代码取代truffle init命令
git clone https://github.com/truffle-box/bare-box
后续的命令需要先执行:cd bare-box

以上两条命令的功能就相当于truffle init,自动生成好了框架。

在使用truffle migrate进行智能合约test环境发布时如果未配置正确会出现以下异常:

Error: No network specified. Cannot determine current network.
    at Object.detect (/usr/lib/node_modules/truffle/build/cli.bundled.js:586
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值