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)
  • Do it on a empty folder. – goodvibration Aug 21 at 12:23
  • i did it before, but it doesn't work, actually vantoken is the new folder – YwD Aug 21 at 12:34
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.

  • 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 Aug 22 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 Aug 22 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. – Prachi Sharma Aug 23 at 3:25
  • i have deleted the truffle and reinstall it again. then it works ,,,, thanks all – YwD Aug 23 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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