5

Running truffle from command line gives me this Windows 7 popup message:

error

While init runs successfully. I see file truffle.js in my project folder. How can I handle this gently?

Stepan Yakovenko
  • 607
  • 1
  • 9
  • 21

2 Answers2

7

Otherwise you can simply rename the file

C:\User\name\AppData\Roaming\npm\truffle.bat

(for exmaple in truf.bat); in this way, as you said, avoid confusion with microsoft command lines.

Update (12.07.2018)

It is a known problem and now also part of the official truffle-documentation. They provide 4 different solutions:

  • Call the executable file explicitly using its .cmd extension (truffle.cmd compile)
  • Edit the system PATHEXT environment variable and remove .JS; from the list of executable extensions
  • Rename truffle.js to something else (truffle-config.js)
  • Use Windows PowerShell or Git BASH, as these shells do not have this conflict.
marc0olo
  • 115
  • 6
d3llafr33
  • 619
  • 5
  • 14
3

This is how I've solved it:

C:\Users\steve\AppData\Roaming\npm\truffle migrate

looks like architecture flaw if truffle: config file is truffle.js, which confuses windows command line...

Stepan Yakovenko
  • 607
  • 1
  • 9
  • 21