2

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

ArifMustafa
  • 4,617
  • 5
  • 40
  • 48

1 Answers1

1

I think the issue were installing truffle using bash su in terminal, hence I exited from the bash su mode to normal user mode and again installed the truffle using following command in my macos (intel version 2019 - BigSur)

sudo npm install -g truffle

post sudo password entering, it installed similarly like earlier, but it worked and resolved my title issue

bash: /usr/local/bin/truffle: Permission denied after below command

truffle version and i got the expected following -

Truffle v5.5.12 (core: 5.5.12)
Ganache v^7.1.0
Solidity v0.5.16 (solc-js)
Node v16.15.0
Web3.js v1.5.3

Hope this experience share would help many blockchain newbies people.

ArifMustafa
  • 4,617
  • 5
  • 40
  • 48
  • for installing ganache-gui, simply goto `https://trufflesuite.com/ganache/` download the executable file and install according to your os. – ArifMustafa May 05 '22 at 15:34