Contents
data/authors/Paul Logan.json

SWA Deployment

Contents

DevOps

Node package installation causes the following build error:

Version ‘14.19.1’ of platform ‘nodejs’ is not installed. Generating script to install it

Could not find either ‘build’ or ‘build:azure’ node under ‘scripts’ in package.json

Could not find value for custom run build command using the environment variable key ‘RUN_BUILD_COMMAND’.

Could not find tools for building monorepos, no ‘lerna.json’ or ‘lage.config.js’ files found.

Removed package.json and package-lock.json to overcome this issue, based on this advice

" I deleted both package.json & package-lock.json which caused the build process to try to install node in the root which is unwanted and impossible anyway it seems."

Could the solution proposed here skip_app_build help? Failed github actions CI/CD deployment to azure

Or how about this: npm ci

Re-installing SWA CLI:

Ran the following in the root of the app to add the CLI as a local/project level dev dependency: npm install -D @azure/static-web-apps-cli

Removed package-lock.json from .gitignore file

Committed, and got the error again

Detected following platforms: nodejs: 14.19.1 Version ‘14.19.1’ of platform ‘nodejs’ is not installed. Generating script to install it… Error: Could not find either ‘build’ or ‘build:azure’ node under ‘scripts’ in package.json. Could not find value for custom run build command using the environment variable key ‘RUN_BUILD_COMMAND’.Could not find tools for building monorepos, no ‘lerna.json’ or ‘lage.config.js’ files found. —End of Oryx build logs— Oryx could not find a ‘build’ or ‘build:azure’ script in the package configuration. Please add one of these commands to your package configuration file (i.e. package.json). Alternatively, you can add the app_build_command to the build/deploy section of your deployment configuration file. For example, app_build_command: ‘npm run docs:build’

Added skip_app_build to build yml file, 😀!