Appcenter-cli: EACCES: permission denied during npm install

Created on 31 Jul 2020  路  14Comments  路  Source: microsoft/appcenter-cli

Hi,

I'm having an issue installing [email protected] using npm 6.14.6.

Here is the trace of the error :

[email protected] preinstall /usr/local/lib/node_modules/appcenter-cli
> cd appcenter-file-upload-client-node && npm i

npm ERR! code EACCES
npm ERR! syscall scandir
npm ERR! path /root/.npm/_logs
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 65534:0 "/root/.npm"
glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs'
}
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /root/.npm/_cacache/index-v5/ce/ae/fd93e677a614f57b325ca5f22842c3e00f2071dd70d44f24a4b413d6fe52
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 65534:0 "/root/.npm"
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 243
npm ERR! [email protected] preinstall: `cd appcenter-file-upload-client-node && npm i`
npm ERR! Exit status 243
npm ERR!
npm ERR! Failed at the [email protected] preinstall 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/2020-07-31T09_44_16_062Z-debug.log

I actually have no error when installing 2.6.3

Thanks

bug

Most helpful comment

for anyone who struggles and don't know how to get it done:

npm cache clean --force
npm install -g appcenter-cli --force

or
use old version for now
npm install -g [email protected]

All 14 comments

Same for me. The new version seems corrupted.

+1

same for me +1

for anyone who struggles and don't know how to get it done:

npm cache clean --force
npm install -g appcenter-cli --force

or
use old version for now
npm install -g [email protected]

Hi,

We're really sorry this is happening for you. Considering this mentions /root I take it this error happened on some Linux distribution? Can we have more details on the environment?

  • linux distribution & version?
  • npm version (I see 6.14.6)?
  • using nvm or similar npm version management tool?
  • previous version of appcenter-cli that was installed
  • using sudo? running as root or normal user?

The following message makes it look like a bug in npm and not the package, but we need to make sure.

npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.

Thanks in advance

Same here. Solved by installing previous version for now npm install -g [email protected]

Hi,

We're really sorry this is happening for you. Considering this mentions /root I take it this error happened on some Linux distribution? Can we have more details on the environment?

  • linux distribution & version?
  • npm version (I see 6.14.6)?
  • using nvm or similar npm version management tool?
  • previous version of appcenter-cli that was installed
  • using sudo? running as root or normal user?

The following message makes it look like a bug in npm and not the package, but we need to make sure.

npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.

Thanks in advance

I am using azure pipelines with these environments:

https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md
https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md

Hi,

We're really sorry this is happening for you. Considering this mentions /root I take it this error happened on some Linux distribution? Can we have more details on the environment?

* linux distribution & version?

* npm version (I see 6.14.6)?

* using nvm or similar npm version management tool?

* previous version of `appcenter-cli` that was installed

* using sudo? running as root or normal user?

The following message makes it look like a bug in npm and not the package, but we need to make sure.

npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.

Thanks in advance

I'm using it in linux docker image
https://github.com/okalman/AppCenter-Github-Action/blob/master/Dockerfile

This version started breaking our CI Pipeline.

Using Gitlab CI with image openjdk:8-jdk.

Example steps:

    - apt-get install -y curl && curl -sL https://deb.nodesource.com/setup_lts.x | bash - && apt-get install -y nodejs && curl -L https://www.npmjs.com/install.sh | sh
    - npm install -g appcenter-cli
  • linux distribution & version?

Image openjdk:8-jdk. Appears to be Debian Jessie.

  • npm version (I see 6.14.6)?

6.14.7

  • using nvm or similar npm version management tool?

No

  • previous version of appcenter-cli that was installed

None

  • using sudo? running as root or normal user?

No

This is happening to me too, running on a Docker image in Bamboo
Docker image: node:10-buster (Debian 10.5)
NPM version: 6.14.6
Using NVM: No
Previous version of appcenter-cli: None
Using sudo: no

Edit - the install works if you omit the -g, but that doesn't help with using the App Center tool - for the meantime I have downgraded to v 2.6.3 as suggested.

Hi,

We're really sorry this is happening for you. Considering this mentions /root I take it this error happened on some Linux distribution? Can we have more details on the environment?

  • linux distribution & version?
  • npm version (I see 6.14.6)?
  • using nvm or similar npm version management tool?
  • previous version of appcenter-cli that was installed
  • using sudo? running as root or normal user?

The following message makes it look like a bug in npm and not the package, but we need to make sure.

npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.

Thanks in advance

Hi, I am having the issue using this docker image node:12.18-alpine

No matter if I use sudo or not to run the npm install command

Okay I know what's up here.
Our preinstall script installs the locally bundled appcenter-file-upload-client-node dependency, and this runs npm i within npm install. On linux, when running as root (or sudo), npm install creates a cache and log files under /root/.npm, but there can only be one at a time. So, the second npm i sees that a file already exists in that folder and bails out.

The solution will be to switch to appcenter-file-upload-client-node from npmjs.org since it's now been published.

This should now be fixed, through a revert. We'll up our testing before releasing the change again in a different format.

This is working again for me (on version 2.6.5) - thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dreamertheat picture dreamertheat  路  5Comments

kartikk picture kartikk  路  5Comments

MihaMarkic picture MihaMarkic  路  4Comments

malwatte picture malwatte  路  6Comments

applied-kevinsalot picture applied-kevinsalot  路  4Comments