# Permission denied scandir /root/npm

**URL:** https://travis-ci.community/t/permission-denied-scandir-root-npm/12651
**Category:** Deployment
**Created:** [February 3, 2022, 7:48pm UTC](https://travis-ci.community/t/permission-denied-scandir-root-npm/12651 "2022-02-03T19:48:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![HILLBILLYHeisT](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/hillbillyheist/32/7476_2.png) [@HILLBILLYHeisT](https://travis-ci.community/u/HILLBILLYHeisT)
#### Post date: [February 3, 2022, 7:48pm UTC](https://travis-ci.community/t/permission-denied-scandir-root-npm/12651/1 "2022-02-03T19:48:53Z")

</div>

I ended up upgrading one of my NodeJS services from 12 to 16 and then I started to get this error on Travis build:

```auto
 glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs'
}

```

My .travis.yml file:

```auto
language: node_js
node_js:
  - 16

services:
  - docker

cache:
  yarn: true
  directories:
    - node_modules

before_install:
  - curl -o- -L https://yarnpkg.com/install.sh | bash -s
  - export PATH="$HOME/.yarn/bin:$PATH"

before_script:
  - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

script:
  - docker-compose run persistence-api npm run test:ci
  - npm run dist

```

any ideas

---

<div class="post-metadata">

### Author: ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)
#### Post date: [February 3, 2022, 7:50pm UTC](https://travis-ci.community/t/permission-denied-scandir-root-npm/12651/2 "2022-02-03T19:50:38Z")

</div>

Try disabling `cache` with `false` values. Remove your `before_install` Travis hook, seems very recursive reading your code, once you do these things try and start the build again.
