question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm install ganache -g failed | Ubuntu 21.10 | node -v v18.0.0 npm -v 8.8.0

See original GitHub issue

Hello @trufflesuite

i am trying to install ganache on ubuntu with the following

npm install ganache --global

i got this errors:

user@ubuntu~$ npm install ganache --global
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/ganache
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ganache'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ganache'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/ganache'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

i search online that on linux you have to use:

$ sudo npm install ganache --global

but for obv reasons, installing npm package with sudo privileges, is not a best practice but this means that i change node_module folder parameters/variables and it could be dangerous for security reason. Am I correct?


Machine Config:

Distributor ID:	Ubuntu
Description:	Ubuntu 21.10
Release:	21.10
Codename:	impish

node -v
v18.0.0

npm -v
8.8.0

How can i fix this? Thanks

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
davidmurdochcommented, May 2, 2022

Ganache GUI and ganache, the command line package, are different things (GUI uses its own ganache cli instance internally based on ganache v6)

2reactions
davidmurdochcommented, May 2, 2022

Was my last answer to this question not sufficient?

Note: official Node 18 support will be in the next release. Try Node 16.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ganache - npm
A tool for creating a local blockchain for fast Ethereum development. Features • Getting Started • Documentation • Community • Docker ...
Read more >
npm global install of ganache-cli fails (because of sudo ...
The basic problem is that globally installing packages with npm links them into directories under /usr/local/ , which are typically owned by ...
Read more >
I Run Ganachecli And It Returned Me Error. I'Ve Reinstall Npm ...
It seems you have a permission issue with your nodejs installation.You can either use 'sudo npm install' command or use some node version...
Read more >
install nodejs and npm on ubuntu 21.10, install sucessful but ...
I am new to js and wanted to install nodejs LTS version and npm on ubuntu 21.10.
Read more >
Unable to install Ganache - Ethereum Stack Exchange
command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found