I am trying to install solidity on my system (Ubuntu 16). I am running the following command:
sudo npm install -g solc
I am getting this error:
/usr/local/bin/solcjs -> /usr/local/lib/node_modules/solc/solcjs
> keccak@1.4.0 install /usr/local/lib/node_modules/solc/node_modules/keccak
> npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."
> keccak@1.4.0 rebuild /usr/local/lib/node_modules/solc/node_modules/keccak
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/user/.node-gyp/8.10.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/solc/node_modules/keccak/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/solc/node_modules/keccak/.node-gyp'
gyp ERR! System Linux 4.15.0-42-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/solc/node_modules/keccak
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keccak@1.4.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Keccak bindings compilation fail. Pure JS implementation will be used.
+ solc@0.5.1
added 76 packages from 30 contributors in 26.079s
How to solve this or how to install solidity?