Can't install electron on debian / ubuntu


#1

dean@debian:~/Documents/dev/electron-examples$ ls
package.json
dean@debian:~/Documents/dev/electron-examples$ cat package.json
{
“name”: “sysinfo-electron”,
“version”: “1.0.0”,
“description”: “A simple system monitor application using the electron framework”,
“main”: “main.js”,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1”,
“start”:“electron .”
},
“author”: “Dean Brown”,
“license”: “ISC”
}
dean@debian:~/Documents/dev/electron-examples$ sudo npm install -g electron
/usr/bin/electron -> /usr/lib/node_modules/electron/cli.js

> electron@2.0.2 postinstall /usr/lib/node_modules/electron
> node install.js

/usr/lib/node_modules/electron/install.js:47
  throw err
  ^

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/electron/.electron'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@2.0.2 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@2.0.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-06-08T09_54_34_694Z-debug.log