0

What to do to resolve below issue coming in initiating a truffle project?

YuweideMacBook-Air:vantoken yuwei$ truffle version
Truffle v4.1.4 (core: 4.1.4)
Solidity v0.4.21 (solc-js) 

YuweideMacBook-Air:vantoken yuwei$ **truffle init**
Downloading...
Error: Something already exists at the destination. Please unbox in an empty folder. Stopping to prevent overwriting data.
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/truffle-box/lib/utils/unbox.js:22:1
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2
  • Do it on a empty folder. Commented Aug 21, 2019 at 12:23
  • i did it before, but it doesn't work, actually vantoken is the new folder
    – YwD
    Commented Aug 21, 2019 at 12:34

1 Answer 1

1

Since you are working on Truffle v4, try these commands in an empty folder:

npm init -y  
truffle init

You can use truffle init --force as well. Check out this Truffle docs for this.

You might want to upgrade Truffle to v5 since v5 allows you to run truffle init in a non-empty folder as well.

4
  • YuweideMacBook-Air:demo1 yuwei$ npm init -y Wrote to /Users/yuwei/Desktop/1110/demo1/package.json: { "name": "demo1", "version": "1.0.0", "description": "", "main": "truffle-config.js", "directories": { "test": "test" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC" } and it doesnt work
    – YwD
    Commented Aug 22, 2019 at 8:54
  • YuweideMacBook-Air:demo1 yuwei$ truffle init Downloading... Error: Something already exists at the destination. Please unbox in an empty folder. Stopping to prevent overwriting data. at /usr/local/lib/node_modules/truffle/build/webpack:/~/truffle-box/lib/utils/unbox.js:22:1 at process._tickCallback (internal/process/next_tick.js:68:7) at Function.Module.runMain (internal/modules/cjs/loader.js:834:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) YuweideMacBook-Air:demo1 yuwei$
    – YwD
    Commented Aug 22, 2019 at 8:54
  • Did you tried other methods as well? Apart from this, if you want, you can change the Truffle source code as well. Check this answer to see how. Commented Aug 23, 2019 at 3:25
  • i have deleted the truffle and reinstall it again. then it works ,,,, thanks all
    – YwD
    Commented Aug 23, 2019 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.