0

I am looking around for questions similar to mine but basically I cannot run any truffle commands in the powershell Ise ONLY. I can make it run on the node.js command line.

example:

> PS C:\Users\user\Documents\internship\Blockcerts\proof-of-existence-master>
> truffle compile 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 compile
> + ~~~~~~~
>     + CategoryInfo          : ObjectNotFound: (truffle:String) [], CommandNotFoundException
>     + FullyQualifiedErrorId : CommandNotFoundException

I tried to follow up a similar question where the answer was to uninstall and install the following but this still occurs.

  • Can you try truffle.cmd instead ? – Ismael Jan 25 '18 at 15:20
  • @Ismael hmm I deleted most truffle files from that folder already so i don't think that will work – ethereumnoob Jan 26 '18 at 1:55
  • I was just asking it is a know issue that truffle.cmd should be used on windows from the command line, but I don't know if this also applies to a power shell console. I'll check when I've the chance. – Ismael Jan 26 '18 at 3:51
0

Please Try it If it was working alright previously, uninstalling and reinstalling truffle should work. npm uninstall -g truffle npm install -g truffle

-g truffle install then work the issue.

In case this does not work, below will work.

run npm init #then will make a new npm project particularly package.json
run npm i truffle #then will download node modules 
run ./node_modules/.bin/truffle init #then will create a truffle project

Try it

Thank You!

  • strange, in a way it works however I have to use the ./node_modules/.bin/ to do the commands on powershell – ethereumnoob Jan 24 '18 at 6:22
  • I did the same but got the following error. Error: Something already exists at the destination. truffle init and truffle unbox must be executed in an empty folder. Stopping to prevent overwriting data. – shantanu chandra Jul 23 '18 at 13:16
0

set the path in the environment variable:

enter image description here

0

Try the following

1.Create a director coin and a sub-directory authcoin

2.cd to coin

run npm init #then will make a new npm project particularly package.json
run npm i truffle #then will download node modules 
run cd authcoin/
run ./../node_modules/.bin/truffle init #then will create a truffle project

or if you run last command in coin directory the error might occur.

Error: Something already exists at the destination. `truffle init` and     `truffle unbox` must be executed in an empty folder. Stopping to prevent overwriting data.

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.