atagulalan / arctis-battery-percentage

🔋 Shows SteelSeries Arctis wireless device's battery percentages as a notification.
MIT License
70 stars 16 forks source link

Impossible Installation on Manjaro #1

Closed olielvewen closed 3 years ago

olielvewen commented 4 years ago

Hi,

I would like to install your software on my Linux Manjaro distribution.

However, I run into an issue when I have tried to install it. Look my terminal output.

npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/lib/node_modules'] {
npm ERR!   stack: "Error: EACCES: permission denied, access '/usr/lib/node_modules'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules'
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.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/olivier/.npm/_logs/2019-10-30T16_41_10_091Z-debug.log
$ sudo npm i -g arctis-battery-percentage

/usr/bin/arctis-battery -> /usr/lib/node_modules/arctis-battery-percentage/percentage.js

> node-hid@0.7.9 install /usr/lib/node_modules/arctis-battery-percentage/node_modules/node-hid
> prebuild-install || node-gyp rebuild

prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/12.13.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/arctis-battery-percentage/node_modules/node-hid/.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/lib/node_modules/arctis-battery-percentage/node_modules/node-hid/.node-gyp'
gyp ERR! System Linux 5.3.7-2-MANJARO
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/arctis-battery-percentage/node_modules/node-hid
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v6.0.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-hid@0.7.9 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-hid@0.7.9 install 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/2019-10-30T16_41_40_858Z-debug.log

I don't think that your sofware is only for Windows but for Linux too.

Could you help me for resolving this issue. You should make a PKBUILD and done an ask for getting it in AUR Package.

BTW. I have a Steelseries Artic Silver 7 Edition 2019. By advance, thanks a lot.

atagulalan commented 4 years ago

It seems like you dont have the permission to access "/root/..." as current user.

You can check this article about solving EACCES error: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

Also, this package was never intented to work on Linux systems at first. I just created headless version of this package, so in theory, you can run it on linux systems now.

You can change branch to headless and try to install after resolving your EACCES problem.

Thank you.

olielvewen commented 4 years ago

@atagulalan

Thanks a lot. I'll take a look deeper soon and I'll give you some feedback.

olielvewen commented 4 years ago

@atagulalan

After several cheese, I've been able to install the headless branch with success.

Now, I must just learn how to use arctis-battery.

[olivier@luthien ~]$ node -v
v12.13.0
[olivier@luthien ~]$ npm -v
6.12.0
[olivier@luthien ~]$ nvm ls
bash: nvm : commande introuvable
[olivier@luthien ~]$ 
[olivier@luthien ~]$ mkdir ~/.npm-global
[olivier@luthien ~]$ npm config set prefix '~/.npm-global'
[olivier@luthien ~]$ source ~/.profile
[olivier@luthien ~]$ npm install -g jshint
/home/olivier/.npm-global/bin/jshint -> /home/olivier/.npm-global/lib/node_modules/jshint/bin/jshint
+ jshint@2.10.2
added 31 packages from 15 contributors in 6.379s

   ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │      New patch version of npm available! 6.12.0 → 6.12.1       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.12.1   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯

[olivier@luthien ~]$ npm i -g git://github.com/atagulalan/arctis-battery-percentage.git#headless
/home/olivier/.npm-global/bin/arctis-battery -> /home/olivier/.npm-global/lib/node_modules/arctis-battery-percentage/percentage.js

> node-hid@0.7.9 install /home/olivier/.npm-global/lib/node_modules/arctis-battery-percentage/node_modules/node-hid
> prebuild-install || node-gyp rebuild

+ arctis-battery-percentage@1.0.4
added 62 packages from 44 contributors in 16.848s
[olivier@luthien ~]$ arctis-battery