Tuesday, 2 Jul 2024
Technology

Build fails code E401

npm err! code e401 npm err! incorrect or missing password.

Suddenly, all attempts to build any of my sites fail with the same issue as shown in the log attached. Here’s the log dump:

Build ready to start

  • build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
  • build-image tag: v4.8.0
  • buildbot version: a0072c9aa857edb8d0052da6c6482646b4348b94
  • Fetching cached dependencies
  • Failed to fetch cache, continuing with build
  • Starting to prepare the repo for build
  • No cached dependencies found. Cloning fresh repo
  • git clone https://github.com/MartyNZ/SOL-xxxx
  • Preparing Git Reference pull/62/head
  • Parsing package.json dependencies
  • Starting build script
  • Installing dependencies
  • Python version set to 2.7
  • Downloading and installing node v16.15.0…
  • Downloading https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.xz
  • Computing checksum with sha256sum
  • Checksums matched!
  • Now using node v16.15.0 (npm v8.5.5)
  • Started restoring cached build plugins
  • Finished restoring cached build plugins
  • Attempting ruby version 2.7.2, read from the environment
  • Using ruby version 2.7.2
  • Using PHP version 8.0
  • No npm workspaces detected
  • Started restoring cached node modules
  • Finished restoring cached node modules
  • Installing NPM modules using NPM version 8.5.5
  • npm ERR! code E401
  • npm ERR! Incorrect or missing password.
  • npm ERR! If you were trying to log in, change your password, create an authentication token, or enable two-factor authentication, then
  • npm ERR! that means you likely typed your password in incorrectly.
  • Creating deploy upload records
  • npm ERR! Please try again, or recover your password at: npm | Recover Password
  • 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:
  • Failed during stage ‘building site’: Build script returned non-zero exit code: 1
  • Error during NPM install
  • Build was terminated: Build script returned non-zero exit code: 1
  • Failing build: Failed to build site
  • Finished processing build request in 24.304667378s
Tham Khảo Thêm:  Is Discord Encrypted? Exploring Discord Privacy & Security

Please explain what I’ve done wrong and how to fix it.

Frequently Asked Questions

Q: What does the error code E401 mean?
A: The error code E401 indicates an incorrect or missing password. If you were trying to log in, make sure to enter the correct password or consider changing it. It is also possible that your saved credentials are out of date, so try logging in again with npm login.

Q: How can I recover my password?
A: To recover your password, please visit the npm Recover Password page here.

Q: What should I do if I encounter a non-zero exit code during the build process?
A: A non-zero exit code typically indicates that there was an error during the build process. To troubleshoot and fix the issue, you can refer to the complete log of the run, which can be found in the /opt/buildhome/.npm/_logs/ directory.

Q: How can I resolve issues with cached dependencies?
A: If the build process fails to fetch cached dependencies, it will continue with a fresh clone of the repository. However, if you encounter issues with cached dependencies, you can try clearing the cache and rebuilding the project.

Conclusion

In this article, we discussed the error code E401 and its possible causes. If you encounter this error during the build process, it is likely related to an incorrect or missing password. Make sure to check your entered password, consider changing it if necessary, and try logging in again with npm login. If the issue persists, you can seek further assistance from npm support or consult the complete log for more details. Remember to always keep your credentials up to date and ensure a smooth build process.

Tham Khảo Thêm:  How to Hard Reset Android Phone without Password