I found a lot of tutorials say anyone who creates dapps needs to use Node Package Manager (NPM).
And the reason why it is necessary is because nodejs console is used for interacting with the contract on the blockchain.
But why do we need nodejs for smart contract? Smart contract is not written by JS but solidity.
Could anyone please simply explain why and for what purpose we need to use npm?

  • 1
    Interaction with smart contracts is done over web3 protocol. This protocol has a variety of implementations, in Javascript, Python, Java and other languages. If your dapp is implemented in Javascript, then installing web3.js with npm (instead of implementing this protocol yourself from scratch) might be a good idea. – goodvibration May 15 at 19:23
  • Thank you so much! – Trey May 15 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.