ERRORS: Trying to install truffle to terminal

Viewed 165

I'm completely new at this and keep getting an error message trying to install truffle. If I need to delete or add anything please explain in detail how to do so.

npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /Users/paulbrady/.npm-global/lib/node_modules/truffle
npm ERR! dest /Users/paulbrady/.npm-global/lib/node_modules/.truffle-f258BAu1
npm ERR! errno -66
npm ERR! ENOTEMPTY: directory not empty, rename '/Users/paulbrady/.npm-global/lib/node_modules/truffle' -> '/Users/paulbrady/.npm-global/lib/node_modules/.truffle-f258BAu1'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/paulbrady/.npm/_logs/2021-05-19T09_32_00_700Z-debug.log
paulbrady@Pauls-MacBook-Air ~ % 
1 Answers

I had similar issue and this is how I solved it

  1. Remove the already installed truffle
sudo -i
cd /usr/local/lib/node_modules/
rm -r truffle .truffle_
  1. Make sure Ganache is running first before reinstalling truffle again

  2. Install Truffle: npm install -g truffle

Related