josselinchevalay / telescope

Other
12 stars 2 forks source link

Electron fails due to "permission denied" #17

Closed lidel closed 7 years ago

lidel commented 7 years ago

Hello,

Installation with npm v5.3.0 yields this warning:

> npm install --dev                                                                                                                                                                                                      130 ~/tmp/telescope master
npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
(...)

When I try to start it, it fails due to permission error:

> ./node_modules/.bin/electron-forge start                                                                                                                                                                                  ~/tmp/telescope ?master
✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies: 1 / 1
✔ Launching Application
Failed to read content scripts { Error: EACCES: permission denied, open '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/inject.js'
    at Object.fs.openSync (fs.js:558:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:173:20)
    at Object.fs.readFileSync (fs.js:468:33)
    at Object.fs.readFileSync (ELECTRON_ASAR.js:506:29)
    at readArrayOfFiles (/home/lidel/tmp/telescope/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/browser/chrome-extension.js:233:23)
    at Array.map (native)
    at contentScriptToEntry (/home/lidel/tmp/telescope/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/browser/chrome-extension.js:240:21)
    at Array.map (native)
    at injectContentScripts (/home/lidel/tmp/telescope/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/browser/chrome-extension.js:248:48)
    at loadExtension (/home/lidel/tmp/telescope/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/browser/chrome-extension.js:277:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/inject.js' }
2017-09-17T15:19:23.346Z - debug: electon is ready wait run ipfs daemon ....
undefined
2017-09-17T15:19:23.349Z - debug: ipfs daemon is started display  main windows
Failed to read content scripts { Error: EACCES: permission denied, open '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/inject.js'
    at Object.fs.openSync (fs.js:558:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:173:20)
    at Object.fs.readFileSync (fs.js:468:33)
    at Object.fs.readFileSync (ELECTRON_ASAR.js:506:29)
    at readArrayOfFiles (/home/lidel/tmp/telescope/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/browser/chrome-extension.js:233:23)
    at Array.map (native)
    at contentScriptToEntry (/home/lidel/tmp/telescope/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/browser/chrome-extension.js:240:21)
    at Array.map (native)
    at injectContentScripts (/home/lidel/tmp/telescope/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/browser/chrome-extension.js:248:48)
    at loadExtension (/home/lidel/tmp/telescope/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/browser/chrome-extension.js:277:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/inject.js' }
2017-09-17T15:19:24.214Z - debug: telescop/file/all data =  
2017-09-17T15:19:29.488Z - debug: telescop/config/get
2017-09-17T15:19:29.496Z - debug: ipfs/config/get
^C%

it is due to odd permissions in ~/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/:

> ls /home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build -l                                                                                                                                      ~/tmp/telescope ?master
ls: cannot access '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/inject.js': Permission denied
ls: cannot access '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/main.js': Permission denied
ls: cannot access '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/background.js': Permission denied
ls: cannot access '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/contentScript.js': Permission denied
ls: cannot access '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/panel.js': Permission denied
ls: cannot access '/home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build/backend.js': Permission denied
total 0
-????????? ? ? ? ?            ? backend.js
-????????? ? ? ? ?            ? background.js
-????????? ? ? ? ?            ? contentScript.js
-????????? ? ? ? ?            ? inject.js
-????????? ? ? ? ?            ? main.js
-????????? ? ? ? ?            ? panel.js

Am I missing something or are installation instructions not up-to-date?

I tested on node v8.5.0 and npm v5.3.0

josselinchevalay commented 7 years ago

hi lidel,

could you try to run with sudo? let me know is ok

Regards

machawk1 commented 7 years ago

I am unable to replicate what @lidel is experiencing in node v7.4.0, npm v4.0.5, and 9326e3319d7b3491b3de53457a8df749121c6dff.

$ npm install --dev
npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
npm WARN electron-app-ipfs@1.0.0 No repository field.
$ ./node_modules/.bin/electron-forge start
✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies: 1 / 1
✔ Launching Application
2017-09-17T19:46:51.100Z - debug: electon is ready wait run ipfs daemon ....
undefined
2017-09-17T19:46:51.400Z - debug: ipfs daemon is started display  main windows
2017-09-17 15:46:52.415 Electron Helper[21033:6569326] Couldn't set selectedTextBackgroundColor from default ()
2017-09-17T19:46:53.054Z - debug: telescop/file/all data = 
lidel commented 7 years ago

Alright, it was on my end then. Running via sudo is a bad practice, so I fixed it by chmod -R 777 /home/lidel/.config/Electron/extensions/fmkadmapgofadopljbjfkapdkoienihi/build