0

Wanted to follow this tutorial to deploy a Defi app.
I use windows and wanted to follow this

mkdir your-project-name # I know its making a directory
cd your-project-name # Iknow I'm entering that directory
truffle init # Did'nt understand this

And tried to run it and got this error

truffle : The term 'truffle' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ truffle init
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (truffle:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I understand cryptic and Defi to an extent but a real rookie in coding.
What to do?

2

2 Answers 2

0

The tutorial you are reading uses truffle.

To install truffle:

npm install -g truffle

Note the Recommendations for Windows:

If you're running Truffle on Windows, you may encounter some naming conflicts that could prevent Truffle from executing properly.

When using the Command Prompt on Windows, the default configuration file name can cause a conflict with the truffle executable, and so you may not be able to run Truffle commands properly on existing projects.

Any of the following solutions will remedy this issue:

  • 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.

https://trufflesuite.com/docs/truffle/reference/configuration#resolving-naming-conflicts-on-windows

1
  • 1
    Thanks for this, but I did use windows power shell
    – Sai Smaran
    Mar 25 at 19:49
0

check to see if truffle is properly installed with

npm list -g

also check your environment variables.

refreshenv

is also good to try if you were expecting something to show but didn't

If it's still not working, you may want to make sure you are in an administrator powershell.

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.