I am unable to install Truflle on my Windows 10. I am running latest versions of npm and node. I have tried uninstalling and then reinstalling but it still doesn't work.

I have installed Truffle using the command

npm install -g truffle

Here is the Screenshot

error image

  • 3
    I'm voting to close this question as off-topic because it is a general javascript problem.
    – niksmac
    Mar 15, 2018 at 5:23
  • Should I ask it on SO?
    – Rohn
    Mar 15, 2018 at 8:29
  • Does it works if called from the cmd shell (as truffle.cmd)? Is C:\Users\<user>\AppData\Roaming\npm in your Path environment variable?
    – Ismael
    Mar 15, 2018 at 16:55

6 Answers 6


Had a simmilar problem when i tried to nstall npm i -g truffle and a restart worked for me. If your truffle is a fresh install, try restarting your PC (the path to truffle will now be in your environment variables). If that does not do the trick, you can always create a local node_modules with truffle installed in it, and then run that copy.

  1. run npm init and make a new npm project
  2. run npm i truffle
  3. run ./node_modules/.bin/truffle init and it should work!

Guys I have tried all the answers shared here and none worked, I don't know if they fixed your issue, but what fixed my issue was running everything normally in the CMD and not POWERSHELL, that's it everything runs smooth and as expected.


Make sure that the powershell window you use has ADMIN rights, then run the following commands in order:

npm install -g npm
npm install -g -production windows-build-tools
npm install -g ethereumjs-testrpc
npm install -g truffle

NOTE: ADMIN powershell: Shift+RightClick over the Powershell icon => Run as Administrator.


You need to update your version of Node.js.. I was having the same problem until I reinstalled Node. This will also update NPM.


If you tried all above solutions and still its not working then try to add Path "C:\Users\xxx\AppData\Roaming\npm" in environment variables.


You can try with "npx truffle init" or others command, dont need truffle version after install "npm install -g truffle"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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