question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows Command Prompt: truffle

See original GitHub issue

Hello all,

The issue I’ve run into while running truffle on Windows lies in running truffle build,truffle serve, etc. using the Windows Command Prompt. When I try to do this in a truffle project directory (for example, the one created when using truffle init, it simply opens truffle.js in the default program associated with JavaScript files (Visual Studio Code for me) and shows a run of errors in the CLI when the program is exited.

The solution I am using right now is to just run the desired truffle command in a given truffle project directory using Git Bash (installed with git for Windows). It seems to run without a hitch. Does anyone have a more elegant fix for the issue?

Many thanks, Nelly

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
mm-nvcommented, Aug 12, 2016

Try these workarounds. (I’m on a windows 7 machine).

  1. Be explicit. use truffle.cmd instead of truffle. e.g. truffle.cmd version
  2. Remove “.JS” from the PATHEXT system var. Based on my experiments, if you dont specify an extension (.xyz) on the command line, windows will append extensions found in the PATHEXT var until it finds a match, first in the current dir, then on the PATH. When windows finds a match, the default program associated with .js extension is executed. Removing .js from PATHEXT will prevent windows from thinking that .js files are executable.
0reactions
dzarezenkocommented, Feb 23, 2018

I have created new file tf.bat in the same directory with truffle.cmd with this command

truffle.cmd %*

and now I simply call tf init, tf compile etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command line options - Truffle Suite
This section will describe every command available in the Truffle application. ... Spawns an interface to interact with contracts via the command line....
Read more >
Truffle for Windows: I can't make it work
When using the Command Prompt on Windows, the default configuration file name can cause a conflict with the truffle executable.
Read more >
How to install Truffle & TestRPC on Windows for Blockchain ...
Step 1. Install Windows tools with Chocolatey: Open a PowerShell prompt as an Administrator and run the following commands (last command optional):
Read more >
Your First Truffle Dapp — An attempt at a beginners guide to ...
Truffle : Development framework for Ethereum ... There are 4 windows command prompts commands that we'll be using:.
Read more >
Getting Error on installing Truffle on windows 10 using npm ...
I was able to get truffle installed on Windows 10 by going one version older. Ran PS in Administrator mode (With Execution Policy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found