I wrote a solidity contract using version 0.4.24 using OpenZeppline-solidity version 1.12.0. This used to deploy using the Nodejs version 8.12. The Nodejs version 8 is no longer being maintained from Jan 2020, so I updated it to 12.18.3 LTS. Now the deployment throws the following error.

truffle deploy --network development


RangeError: Maximum call stack size exceeded

Truffle v5.1.39 (core: 5.1.39) Node v12.18.3


compilers: {
    solc: {
      version: "0.4.24",
      settings: {         
       optimizer: {
         enabled: true,
         runs: 200

Node.js versions are mostly backward compatible, meaning that code you wrote for Node 8 will work on Node 10 or 12.

package.json dependencies

"dependencies": {
    "openzeppelin-solidity": "^1.12.0",
    "@truffle/hdwallet-provider": "^1.0.42",
    "retry": "^0.12.0",
    "solc": "^0.4.24",
    "truffle": "^5.1.39",
    "web3": "^1.2.11"
  • 1
    Likely some compatibility issue. Just keep using the dedicated Node version and environment for maintaining old contracts. NVM is your friend github.com/nvm-sh/nvm – Mikko Ohtamaa Aug 13 '20 at 11:16

Use node version 10.x or 11.x

To install node versions using nvm:

nvm install node-v11.15.0

or to install node v10 LTS

nvm install node-v10.22.0

To use the node version installed:

nvm use 11.15.0

or to use node v10 LTS

nvm use 10.22.0

Then delete the previous node modules folder and package-lock.json from the working directory.

npm i

truffle deploy --network development

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.