Reputation: 541
I have an Existing Azure Static Web App with existing code in Github. Everything works fine.
I tried to create a new static web app and linked the existing github repo to the new Azure Static Web app.
I encounter this issue: Detecting platforms... Detected following platforms: nodejs: 16.19.0 Version '16.19.0' 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.
How to solve this?
My package.json does not have any build either but my App works and its building correctly with no issues in the old one:
{
"name": "vanilla-basic",
"version": "1.0.0",
"scripts": {
"start": "sirv ./src public --cors --single --no-clear --port 8000"
},
"dependencies": {
"dotenv": "^16.0.3"
}
}
Upvotes: 1
Views: 1942
Reputation: 541
I finally solved it.. When i created my first azure static web app I used the custom build presets in this quick start: https://learn.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript&pivots=github
Select Custom from the Build Presets dropdown. Type ./src in the App location box. Leave the Api location box empty. Type ./src App artifact location box.
Upvotes: 1