I tried to install truffle, and got many videos/solutions but older than a year on youtube or other webpages post searching.
Helpfully I got few videos on youtube post filtering "this year" in May 2022, but the solution what they were suggesting was not fluently working, but solved with a little trick.
First attempt:
installed homebrew, and upgrade my nodejs, but the nodejs didn't got upgrade, and were still showing the existing node version, hence simply downloaded the nodejs macos LTS .dmg file, then it replaced and upgraded the existing from 14th to 16th Node, if you didn't do this, there were some Math function needed by truffle from NodeJS, introduced in 16th NodeJS but didn't available in 14th version, so please first upgrade the NodeJS, but still my truffle install were failing due to permission issue.
Second attempt:
Once I upgraded my NodeJS to 16.. version, I switched to sudo -s
to Super User in mac, and installed the npm install truffle -g
, and post install it in bash
su mode, tried to check truffle version with truffle version
, but got -
bash: /usr/local/bin/truffle: Permission denied