Why does NPM try to log in?

NPM keeps trying to log in when I run my pipeline, but I do not know why. My project is located in a private repository from a GitHub organization (I'm the CEO and the janitor at the same time). This is my package.json: ` { "name": "website", "version": "0.1.0", "private": true, "scripts": { "build": "next build", "dev": "next dev", "postinstall": "prisma generate", "lint": "next lint", "start": "next start", "prepare": "husky install", "test:e2e": "playwright test", "test": "jest --watch" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.4.0", "@fortawesome/free-brands-svg-icons": "^6.4.0", "@fortawesome/free-regular-svg-icons": "^6.4.0", "@fortawesome/free-solid-svg-icons": "^6.4.0", "@fortawesome/react-fontawesome": "^0.2.0", "@next-auth/prisma-adapter": "^1.0.5", "@prisma/client": "^4.11.0", "@tanstack/react-query": "^4.28.0", "@trpc/client": "^10.18.0", "@trpc/next": "^10.18.0", "@trpc/react-query": "^10.18.0", "@trpc/server": "^10.18.0", "daisyui": "^2.51.5", "next": "^13.2.4", "next-auth": "^4.21.0", "prettier": "^2.8.7", "react": "18.2.0", "react-dom": "18.2.0", "react-select": "^5.7.2", "superjson": "1.12.2", "zod": "^3.21.4" }, "devDependencies": { "@playwright/test": "^1.34.3", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^14.0.0", "@types/eslint": "^8.21.3", "@types/node": "^18.15.5", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", "autoprefixer": "^10.4.14", "eslint": "^8.36.0", "eslint-config-next": "^13.2.4", "eslint-config-prettier": "^8.8.0", "husky": "^8.0.3", "postcss": "^8.4.23", "prisma": "^4.11.0", "tailwindcss": "^3.3.1", "typescript": "^5.0.2" }, ... }
7 Replies
Josh
Josh2y ago
What pipeline are you running? And what do you mean by log in? We need more context here
ceespert
ceespertOP2y ago
My apologies, my pipeline is (GitHub workflow):
name: Test Workflow
on:
pull_request:
branches:
- dev
push:
branches:
- dev
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "18.16.x"
- name: Install dependencies
run: npm ci
name: Test Workflow
on:
pull_request:
branches:
- dev
push:
branches:
- dev
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "18.16.x"
- name: Install dependencies
run: npm ci
... and the error is:
Run npm ci

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/2023-06-08T06_46_23_860Z-debug-0.log
Error: Process completed with exit code 1.
Run npm ci

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/2023-06-08T06_46_23_860Z-debug-0.log
Error: Process completed with exit code 1.
Josh
Josh2y ago
Do you buy chance have a rouge npmrc file
ceespert
ceespertOP2y ago
Nope, I do not have an .npmrc file
Josh
Josh2y ago
Stack Overflow
Unable to install public NPM-package from Github Package Registry u...
There is a public NPM package in the Github Package Registry im trying to install using Github Actions. I have added a .npmrc file next to my package.json with the line @instacart:registry=https://...
Josh
Josh2y ago
Also see if your at the latest version for setup node and checkout
ceespert
ceespertOP2y ago
GITHUB_TOKEN Permissions
Actions: write
Checks: write
Contents: write
Deployments: write
Discussions: write
Issues: write
Metadata: read
Packages: write
Pages: write
PullRequests: write
RepositoryProjects: write
SecurityEvents: write
Statuses: write
GITHUB_TOKEN Permissions
Actions: write
Checks: write
Contents: write
Deployments: write
Discussions: write
Issues: write
Metadata: read
Packages: write
Pages: write
PullRequests: write
RepositoryProjects: write
SecurityEvents: write
Statuses: write
My GITHUB_TOKEN permissions seem to be fine.
- name: Install dependencies
run: npm ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: npm ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This is the latest tweak to my workflow, but still the same 401 error. rip I accidentally installed a Fontawesome dependency that was not free. Removing them fixed the issue.
Want results from more Discord servers?
Add your server