Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Support global or root-user installations on Linux #13

Closed
TekuConcept opened this issue Jan 21, 2020 · 5 comments
Closed

Support global or root-user installations on Linux #13

TekuConcept opened this issue Jan 21, 2020 · 5 comments

Comments

@TekuConcept
Copy link

Any attempt to install the qode npm package as the super user fails.

npm install -g @nodegui/qode fails to run with Error while setting up Qode { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@nodegui/qode/dist']

cd /root && npm install @nodegui/qode fails with Cannot find module '/root/node_modules/@nodegui/qode/install.js'

cd /home/some_user/Desktop/some_folder && npm install @nodegui/qode fails with Failed at the @nodegui/qode@1.0.6 postinstall script.

Running npm install @nodegui/qode in any other folder as a non-super-user works.

System Information:

  • Linux Mint 19 AMD64
  • npm 6.13.6
@TekuConcept
Copy link
Author

TekuConcept commented Jan 21, 2020

npm install -g @nodegui/qode --loglevel verbose --unsafe-perm true just yielded a successful install as the super user, and qode -v prints "12.6.1". But... running the same command as a normal user returns the error

Error: spawn /usr/local/lib/node_modules/@nodegui/qode/dist/1.0.6/qode EACCES

Update: running chmod +x /usr/local/lib/node_modules/@nodegui/qode/dist/1.0.6/qode fixed the issue. Don't know why I didn't catch that earlier.

@a7ul
Copy link
Collaborator

a7ul commented Jan 22, 2020

Hi @TekuConcept
Is there a specific reason you need qode to be installed globally ?

@TekuConcept
Copy link
Author

Is there a specific reason you need qode to be installed globally ?

First, I have a development linux system where root is the only user. (It’s a barebones system.) As I demonstrated in the second attempt above, qode could not even be installed in some local folder as root.

Second, I wanted to run nodegui-specific apps without npm or running npm start. I also wanted to make it easier to write up a ts-node compatible script using qode, which I did find success with.

I shared my workaround solution above in the second post.

@a7ul
Copy link
Collaborator

a7ul commented Jan 22, 2020

Just a suggestion (not sure if you already know this) :
if you dont want to use npm start you could also do ./node_modules/.bin/qode index.js instead.

In any case can I close this issue since there is nothing to be done here ?

@TekuConcept
Copy link
Author

TekuConcept commented Jan 22, 2020

I already know about the node_modules/.bin folder. Let’s drop the concept of installing globally and instead focus on installing locally...

I cannot install locally as root. (where root is the only user available and creating a new user is not an option)

I’ll hopefully come back later with a patch to help fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants