pogbamessi
pogbamessi

Reputation: 333

Getting npm permission error when doing npm ci on windows self hosted runner

I am working on a github action where I have to install dependencies using npm ci command. I am using a self-hosted windows runner. Here's my github action:

name: test build
on:
  workflow_dispatch:
  push:
    branches:
      - my-branch-name
jobs:
  linting:
    runs-on: [self-hosted, windows]
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Install Nodejs
        uses: actions/setup-node@v4
        with:
          node-version: 18.18.2
      - name: Clear npm cache
        run: npm cache clean --force
      - name: Install dependencies
        run: npm ci

The actions fails at npm ci step giving me the following error: enter image description here

Some blogs recommended to clear the npm cache but I still got the same error. I think it's a permission issue but I tried some commands to open the command prompt as administrator but it still didn't work. Any help is appreciated. Thank You!

Upvotes: 0

Views: 80

Answers (0)

Related Questions