Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
318 stars 53 forks source link

Unable to deploy static web app #1224

Open johncurwen81outlook opened 11 months ago

johncurwen81outlook commented 11 months ago

Description

I get the following error when trying to deploy a React app to an Azure static web app:

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!     /root/.npm/_logs/2023-07-12T10_22_15_527Z-debug-0.log

---End of Oryx build logs---
Oryx has failed to build the solution.

For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
Exiting
##[error]Error: The process '/usr/bin/bash' failed with exit code 1
Finishing: AzureStaticWebApp

Steps to reproduce the behavior

  1. Create a static web app in the Azure portal.
  2. During configuration of the static web app, connect the web app to an Azure DevOps repo branch containing a CRA React app.
  3. Make a commit to the connected branch to trigger the Azure Pipelines .yml file created by the Azure static web app.
  4. Observe as the build fails with the error message provided above.

Expected behavior For the React app to be successfully deployed to the Azure static web app.

Screenshots image

Attachments staticwebapp.config.zip azure-static-web-apps.zip

thomasgauvin commented 11 months ago

Your logs seem related to an error building your specific project, specifically related to an action requiring a password? This would be something that needs to be fixed before deploying to Static Web Apps. Try building the project locally to see if it can be debugged or if further information can be obtained regarding the issue

johncurwen81outlook commented 11 months ago

It builds and runs fine locally. This issue started without any code changes to the master branch. One day it was building fine in Azure, the next it wasn't. The error presented alludes to an authentication error when login in to npm, bit as far as I know npm authentication is handled by Azure when building static web apps.

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Thomas Gauvin @.> Sent: Wednesday, July 19, 2023 2:24:07 AM To: Azure/static-web-apps @.> Cc: johncurwen81outlook @.>; Author @.> Subject: Re: [Azure/static-web-apps] Unable to deploy static web app (Issue #1224)

Your logs seem related to an error building your specific project, specifically related to an action requiring a password? This would be something that needs to be fixed. Try building the project locally to see if it can be debugged or if further information can be obtained regarding the issue

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/static-web-apps/issues/1224#issuecomment-1641193542, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BBHDQHO4XRLIFS3AANPWFILXQ4SKPANCNFSM6AAAAAA2HJLS4Q. You are receiving this because you authored the thread.Message ID: @.***>

man-cat commented 10 months ago

I am also receiving a similar error when trying to deploy a nuxt3 app to an azure static app. I'm running the default build that is created after creating the static web app on azure and connecting it to your devops instance with the nuxt3 template. It's failing on the same exact step as the OP

`Removing existing manifest file Creating directory for command manifest file if it does not exist Creating a manifest file... Node Build Command Manifest file created.

Using Node version: v16.20.1

Using Npm version: 8.19.4

Running 'npm install'...

npm ERR! code E401 npm ERR! Unable to authenticate, your authentication token seems to be invalid. npm ERR! To correct this please trying logging in again with: npm ERR! npm login

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2023-08-08T12_34_51_218Z-debug-0.log `

man-cat commented 10 months ago

Seems I got past the issue, it was my fault. My npm registry was pointing to a private feed as a result from another project I'm working on. I deleted the package-lock.json file, node modules, cleared cache, changed feed to point to the public feed, then ran an npm install again to fix the issue.

man-cat commented 10 months ago

would be great if there was a way to download the npm log files referenced in the build here: /root/.npm/_logs/, would have saved a lot of time.

joyacar commented 8 months ago

i have a same error, please can you help us.

Captura de pantalla 2023-10-11 a la(s) 11 30 54

i reading for this issue in internet and not be concret solucition. maybe the problem is by disponibility for services, but i don't think that's it