FortAwesome / react-fontawesome

Font Awesome React component
https://fontawesome.com
MIT License
3.67k stars 262 forks source link

npm ERR! code E401 when running npm ci on github action or server using the FREE pack only #556

Closed Dinkelborg closed 6 months ago

Dinkelborg commented 7 months ago

Describe the bug When trying to run npm ci on either my server or inside a github action the install fails every time saying

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.

I'm only using:

    "@fortawesome/fontawesome-svg-core": "^6.5.1",
    "@fortawesome/free-solid-svg-icons": "^6.5.1",
    "@fortawesome/react-fontawesome": "^0.2.0",

so I should need no authentication, when I remove those three packages the install works fine, as soon as I reinstall them the issue returns

Reproducible test case I'm running a basic gatsby setup to reproduce, gatsby init a new typescript site and install the above mentioned packages

Expected behavior No authentication should be required using the free packages - this issue also only occurs when its not on my local machine (coulc be due to auth keys present in my general system config)

Desktop (please complete the following information):

Dinkelborg commented 7 months ago

Finally after hours of trying different things the github pipeline finally went through I added steps to the action that delete the package.lock file and then perform npm install instead of npm ci

this is not a permanent solution as ci is save for servers, install is not

If anybody has any idea why the github action would not be able to use my package-lock file (I did delete it locally, updated npm, node and what not and recreated it) please let me know ... its super weird locally I can just run npm ci - no issues and I'm using the exact same node version and everything - I also was able to run npm ci on my server again suddenly for no reason, just github fails with the E401 error from above if I only do npm ci

heres the github action anyway in case anyone can use it:

name: Build Gatsby Site and Deploy

on:
  push:
    branches:
      - develop

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20.10

      - name: Delete Package Lock
        run: rm package-lock.json

      - name: Clean Install
        run: npm install

      - name: Gatsby Clean
        run: npm run clean

      - name: Gatsby Build
        run: npm run build

      - name: Deploy
        run: rm -rf live && cp -R public live
robmadole commented 6 months ago

@Dinkelborg I suggest that you take a look at our troubleshooting section: https://fontawesome.com/docs/web/setup/packages

It sounds like your local system is configured to use npm.fontawesome.com for anything under the @fortawesome scope. Running npm config list might shed some light on a config file that is writing this service into your lock files.