After installing Truffle with yarn add truffle, the following line shows up in package.json:

  "truffle": "^5.1.52"

In the root directory of the project, the truffle version prints out the following:

$truffle version
Truffle v4.1.12 (core: 4.1.12)
Solidity v0.4.24 (solc-js)

Why is the Truffle version from command line is one version older than it is in the package.json?

1 Answer 1


When you run truffle version, you are asking for the version of your globally installed Truffle. You can run this command from any directory and you will get the same result.

To see the Truffle version of your project, you can run npx truffle version.

Your Answer

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

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