aws-amplify / aws-amplify/amplify-hosting

Frontend build failing with npm ERR! code E401 Incorrect or missing password.

Open
#3,403 3 comments 0 reactions 0 assignees View on GitHub
frontend-builds investigating question
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

d2zkpy9s6mky8z

### AWS Region

us-west-1

### Amplify Hosting feature

Frontend builds

### Describe the bug

I am trying to deploy a React frontend app, but keep running into this error: npm error code E401 Incorrect or missing password.

### Expected behavior

Frontend build completes successfully and app is deployed.

### Reproduction steps

1. Click on "Build" step on Amplify console main page.
2. Click on "Redeploy this version."
3. See error appear in build logs.

### Build Settings

```yaml
version: 1
frontend:
phases:
preBuild:
commands:
- cd client
- npm install
# IMPORTANT - Please verify your build commands
build:
commands:
- npm run build
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: ./client/build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
```

### Log output

```
# Put your logs below this line
# Starting phase: preBuild
# Executing command: cd client
2023-04-03T20:22:44.681Z [INFO]: # Executing command: npm install
2023-04-03T20:22:57.346Z [WARNING]: npm
2023-04-03T20:22:57.348Z [WARNING]: WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
2023-04-03T20:22:58.047Z [WARNING]: npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
2023-04-03T20:22:58.186Z [WARNING]: npm WARN deprecated
2023-04-03T20:22:58.186Z [WARNING]: w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
2023-04-03T20:22:58.270Z [WARNING]: npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
2023-04-03T20:22:58.508Z [WARNING]: npm WARN
2023-04-03T20:22:58.509Z [WARNING]: deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
2023-04-03T20:23:01.457Z [WARNING]: npm WARN
2023-04-03T20:23:01.459Z [WARNING]: deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
2023-04-03T20:23:14.382Z [WARNING]: npm ERR! code E401
2023-04-03T20:23:14.384Z [WARNING]: 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
2023-04-03T20:23:14.384Z [WARNING]:
2023-04-03T20:23:14.385Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-04-03T20_22_44_907Z-debug-0.log
2023-04-03T20:23:14.412Z [ERROR]: !!! Build failed
2023-04-03T20:23:14.412Z [ERROR]: !!! Non-Zero Exit Code detected
2023-04-03T20:23:14.412Z [INFO]: # Starting environment caching...
2023-04-03T20:23:14.412Z [INFO]: # Environment caching completed
Terminating logging...

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the reported Amplify build logs and the frontend build settings, especially the `npm install` command in the `preBuild` phase. Investigate the E401 authentication failure and determine what configuration is required; done means the frontend build completes and the app deploys successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, react
Domain
ci-cd, cloud, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.