truffle初始化的坑有很多:
1. truffle init报错
truffle init
报错: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 clone https://github.com/truffle-box/bare-box
然后进入bare-box:cd bare-box
可以看到我们需要的初始化的内容已经都在里面了。继续working。
2. truffle unbox报错
truffle unbox webpack
初始化时:Truffle Box at URL https://github.com/truffle-box/webpack-box doesn’t exist.
或者:
解决方法:同样的,使用另一种方法来unbox这个项目
git clone https://github.com/trufflesuite/truffle-init-webpack.git
$ cd truffle-init-webpack
就一样啦。