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 '18 at 5:23
  • Should I ask it on SO? – Rohn Mar 15 '18 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 '18 at 16:55

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!

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


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.


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.

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.