Linux permission issue, unable to run unless root


#1

I am trying to run my application as a regular user, I have been managing with using sudo as I develop but as I am now generating files doing so as sudo locks them to root and makes it a pain to deal with. I used the electron quick start package to start developing.

npm start:

quick-start@1.0.0 start /home/drew/Documents/Projects/quick-start/src
electron .

/home/drew/Documents/Projects/quick-start/src/app/main.js:62

app.on(‘ready’, createWindow)
^

TypeError: Cannot read property ‘on’ of undefined
at Object. (/home/drew/Documents/Projects/quick-start/src/app/main.js:62:4)
at Module._compile (module.js:556:32)
at Object.Module._extensions…js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:402:7)
at startup (bootstrap_node.js:157:9)
at bootstrap_node.js:521:3

npm ERR! Linux 4.7.10-1-MANJARO
npm ERR! argv “/usr/bin/node” “/usr/bin/npm” "start"
npm ERR! node v7.2.1
npm ERR! npm v4.0.3
npm ERR! code ELIFECYCLE
npm ERR! quick-start@1.0.0 start: electron .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the quick-start@1.0.0 start script ‘electron .’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the quick-start package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs quick-start
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls quick-start
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/drew/Documents/Projects/quick-start/src/npm-debug.log

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘start’ ]
2 info using npm@4.0.3
3 info using node@v7.2.1
4 verbose stack Error: ENOENT: no such file or directory, open '/home/drew/package.json’
5 verbose cwd /home/drew/Documents/Projects/quick-start
6 error Linux 4.7.10-1-MANJARO
7 error argv “/usr/bin/node” “/usr/bin/npm” "start"
8 error node v7.2.1
9 error npm v4.0.3
10 error path /home/drew/package.json
11 error code ENOENT
12 error errno -2
13 error syscall open
14 error enoent ENOENT: no such file or directory, open '/home/drew/package.json’
15 error enoent ENOENT: no such file or directory, open '/home/drew/package.json’
15 error enoent This is most likely not a problem with npm itself
15 error enoent and is related to npm not being able to find a file.
16 verbose exit [ -2, true ]


#2

You should chown Electron and all of your files to your user account.


#3

So it turns out it is not a permission issue after all. I have previously ran chown, but did it again and further up just to make sure, did not fix the issue. The issue is when I try to run npm start from the terminal in atom (platformio-ide-terminal) it fails to run and causes the above mentioned errors. When I ran npm start in a regular terminal in the directory it ran perfectly.

Got a fix for the package terminal, I prefer using that. Just a minor gripe otherwise.