Hi James Pierce,
Thank you for sharing the final update and the detailed steps you followed to resolve the issue. I’m glad to hear that everything is working as expected on your secondary machine now! I appreciate your patience and effort in troubleshooting and documenting the process.
- Install Node Version Manager (NVM):
- Installed Node Version Manager for managing Node.js versions (NVM Installation Guide).
- Used
nvm install 20
to install Node.js version 20 and the relevant npm version. - Used
nvm use 20
to set Node.js version 20 as the active version.
- Install Azure Static Web Apps CLI (SWA):
- Ran
npm install -g @azure/static-web-apps-cli
to globally install the Static Web Apps CLI.
- Ran
- Install Azure CLI:
- Followed the step-by-step instructions to install Azure CLI (Azure CLI Installation Guide).
- Login to Azure and SWA:
- Used
az login
to log in to the Azure tenant, ensuring 2FA authentication was completed. - Ran
swa login
to log in to the Azure Static Web Apps CLI and synchronize it with the Azure account.
- Used
- Generate SWA Configuration File:
- Executed the
swa
command to generate a new configuration file (swa-cli.config.json
) for the project.
- Executed the
- Prepare the Deployment Folder:
- Identified and resolved the "Current directory cannot be identical to or contained within artifact folders" error by navigating up one directory and specifying the correct output folder.
- Deploy the Project:
- Used the following command for the final deployment.
swa deploy --output-location . --env Production --api-language none --api-version none --verbose -a ./TestWebApp
- Used the following command for the final deployment.
- Key flags included:
-
--env Production
to deploy to the correct environment. -
--output-location .
to specify the folder containing the deployment files. -
-a ./TestWebApp
to avoid directory structure conflicts.
-
- Clean Up:
- Removed the unnecessary
node_modules
folder from the project directory to resolve a space issue (284MB). It had no impact on the functionality. I’m happy we could work together to navigate the challenges, and I’m truly grateful for your detailed feedback and updates throughout the process. If you encounter any further issues or need assistance in the future, feel free to reach out! Thank you again for allowing me to assist you with this.
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.
- Removed the unnecessary