Description of problem: I believe that there is a permission issue with the execution of the npm command to install yarn. Running ls /usr/lib/node_modules/ shows that root owns both directories even though I haven't runned the install command as sudo or as root: [kristoffer@Desktop ~]$ ls -ls /usr/lib/node_modules/ totalt 8 4 drwxr-xr-x 4 root root 4096 jan 28 15:05 corepack/ 4 drwxr-xr-x 8 root root 4096 jan 28 15:05 npm/ I know that it's not recommended to run anything as root unless one knows what they're doing so I don't know what needs to be solved with the npm package for future releases. Version-Release number of selected component (if applicable): 6.14.17 How reproducible: All the time. Steps to Reproduce: 1. Install npm. 2. Run npm install --global yarn. 3. npm fails with a errno -13 message that states Error: EACCES: permission denied, access '/usr/lib/node_modules'
Created attachment 13661 [details] Complete log file
CC: (none) => lovaren
It mentioned in this issue on the yarn GitHub repo: https://github.com/yarnpkg/yarn/issues/1806
Searching the issues tab using "access denied" shows that more than me experience this as well.
You need to run "sudo npm install --global yarn" or "su -c 'npm install --global yarn'" .... That's it...
Btw why do you expect to have write permission as normal user for /usr/lib/? You need root or sudo rights for it...
(In reply to sturmvogel from comment #4) > You need to run "sudo npm install --global yarn" or "su -c 'npm install > --global yarn'" .... > > That's it... Of course, but if you look at this section for instance, you see that it doesn't mention the need for using sudo or su -c which is odd if you really must use it: https://github.com/signalapp/Signal-Desktop/blob/main/CONTRIBUTING.md#all-platforms
Comment 2 leads to the solutions. 1. As already mentioned in comment 4: sudo npm i yarn --global or sudo npm install --global yarn or su -c 'npm install --global yarn' 2. remove the node_modules & yarn.lock and run 'yarn' pr deleted node_modules and yarn.lock and run yarn add [libToInstall] Closing as it is not a Mageia problem, but generic application.
Status: NEW => RESOLVEDCC: (none) => lewyssmithResolution: (none) => WORKSFORME