Issues running Truffle in the command line

I am having difficulties installing the truffle framework in my command line.

I have the current version of node.js

I tried installing the following:
sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib/node_modules/
sudo npm install --save-dev truffle-environment

Then, “npm install -g truffle”, but I still get an error
I also tried “npm install -g ganache-cli”

I just receive a whole bunch of errors, and when I try to install truffle or ganache, such as:

Error: EACCES: permission denied, symlink ‘…/lib/node_modules/truffle/build/cli.bundled.js’ -> ‘/usr/local/bin/truffle’
npm ERR! [OperationalError: EACCES: permission denied, symlink ‘…/lib/node_modules/truffle/build/cli.bundled.js’ -> ‘/usr/local/bin/truffle’] {
npm ERR! cause: [Error: EACCES: permission denied, symlink ‘…/lib/node_modules/truffle/build/cli.bundled.js’ -> ‘/usr/local/bin/truffle’] {
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘symlink’,
npm ERR! path: ‘…/lib/node_modules/truffle/build/cli.bundled.js’,
npm ERR! dest: ‘/usr/local/bin/truffle’
npm ERR! },
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘symlink’,
npm ERR! path: ‘…/lib/node_modules/truffle/build/cli.bundled.js’,
npm ERR! dest: ‘/usr/local/bin/truffle’
npm ERR! }

Does anyone have any suggestions?? Thanks!

Try the same command to install ganache or truffle but with sudo privileges

Carlos Z

1 Like

That got it to work! Thanks my man

1 Like