使用Static Web Apps CLI部署Azure静态Web应用时的Node错误解决
使用SWA CLI部署静态HTML网站时出现NativeCommandError
我尝试用Azure Static Web Apps CLI部署一个简单的HTML网站,执行的部署命令如下:
swa deploy --api-language none --api-version none --env Production --verbose > deployment-log.txt 2>&1
部署日志输出如下:
Welcome to Azure Static Web Apps CLI (2.0.3) Using configuration "static-web-apps-play-ground" from file: C:\Users\####\source\repos\StaticWebApps-PlayGround\swa-cli.config.json Deploying front-end files from folder: C:\Users\####\source\repos\StaticWebApps-PlayGround\src Deploying to environment: Production Deploying project to Azure Static Web Apps... node.exe : - Preparing deployment. Please wait... At C:\nvm4w\nodejs\swa.ps1:16 char:5 + & "$basedir/node$exe" "$basedir/node_modules/@azure/static-web-a ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (- Preparing deployment. Please wait...:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
使用的swa-cli.config.json配置内容:
{ "$schema": "https://aka.ms/azure/static-web-apps-cli/schema", "configurations": { "static-web-apps-play-ground": { "appLocation": "./src/", "appName": "swa-playground", "resourceGroup": "rg-swa-playground" } } }
已尝试过的环境版本:
- Node.js版本:20.18.3、18.17.1、16.20.2
- SWA CLI版本:2.0.3
内容的提问来源于stack exchange,提问作者user3845056
相关产品推荐
相关产品推荐

