2

I'm running npm ci on Node 16 in GitHub workflow actions and keep getting the following error:

npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR!     https://www.npmjs.com/forgot
npm ERR! 
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR!     npm login

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-01-10T11_38_28_617Z-debug.log
Error: Process completed with exit code 1.

I tried deleting the package-lock.json file and running npm i locally and uploading the new file. But it did not make a difference.

Workflow file

name: Node.js CI

on:
  push:
    branches: [ "*" ]
  pull_request:
    branches: [ "*" ]

jobs:
  test:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - name: Build the Docker image and run tests
      uses: actions/checkout@v2
    - run: npm ci
    - run: npm test

Please advise how I can resolve this.

David Faizulaev
  • 4,651
  • 21
  • 74
  • 124

1 Answers1

-1

Looks like some of the packages in your package-lock.json file are in private registries.

You need to login to that registry as it is saying in the error. Otherwise NPM cannot pull those packages.

Gerard Wilkinson
  • 1,512
  • 14
  • 33