TeamFx GitHub 操作因 teamsFx npm 错误而失败
TeamFx GitHub Action failing with teamsFx npm error
所以当我尝试 运行 操作时:
Run OfficeDev/teamsfx-cli-action@v1
我收到以下错误:
/usr/local/bin/npx teamsfx config set run-from GitHubAction
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/teamsfx - Not found
npm ERR! 404
npm ERR! 404 'teamsfx@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-11-25T13_27_07_216Z-debug.log
Install for [ 'teamsfx@latest' ] failed with code 1
Error: The process '/usr/local/bin/npx' failed with exit code 1
我不确定我在这里遗漏了什么,我使用的 ci/cd 脚本是描述的默认操作 here
我的脚本非常简单,所以我可能只是遗漏了一些明显的东西:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
AZURE_ACCOUNT_NAME: ${{secrets.AZURE_ACCOUNT_NAME}}
AZURE_ACCOUNT_PASSWORD: ${{secrets.AZURE_ACCOUNT_PASSWORD}}
AZURE_SUBSCRIPTION_ID: ${{secrets.AZURE_SUBSCRIPTION_ID}}
AZURE_TENANT_ID: ${{secrets.AZURE_TENANT_ID}}
M365_ACCOUNT_NAME: ${{secrets.M365_ACCOUNT_NAME}}
M365_ACCOUNT_PASSWORD: ${{secrets.M365_ACCOUNT_PASSWORD}}
M365_TENANT_ID: ${{secrets.M365_TENANT_ID}}
steps:
# Provision resources.
- uses: OfficeDev/teamsfx-cli-action@v1
with:
commands: provision
subscription: ${{env.AZURE_SUBSCRIPTION_ID}}
# Deploy the code.
- uses: OfficeDev/teamsfx-cli-action@v1
with:
commands: deploy
# Publish the Teams App.
- uses: OfficeDev/teamsfx-cli-action@v1
with:
commands: publish
您错过了 teamsfx-cli
。见 docs:
"devDependencies": { "@microsoft/teamsfx-cli": "^0.3.1" }
安装完成后,命令 npx teamsfx
就可以使用了。
就工作流程的更改而言,您可能希望首先检查项目,然后 运行 npm ci
。
所以当我尝试 运行 操作时:
Run OfficeDev/teamsfx-cli-action@v1
我收到以下错误:
/usr/local/bin/npx teamsfx config set run-from GitHubAction
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/teamsfx - Not found
npm ERR! 404
npm ERR! 404 'teamsfx@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-11-25T13_27_07_216Z-debug.log
Install for [ 'teamsfx@latest' ] failed with code 1
Error: The process '/usr/local/bin/npx' failed with exit code 1
我不确定我在这里遗漏了什么,我使用的 ci/cd 脚本是描述的默认操作 here
我的脚本非常简单,所以我可能只是遗漏了一些明显的东西:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
AZURE_ACCOUNT_NAME: ${{secrets.AZURE_ACCOUNT_NAME}}
AZURE_ACCOUNT_PASSWORD: ${{secrets.AZURE_ACCOUNT_PASSWORD}}
AZURE_SUBSCRIPTION_ID: ${{secrets.AZURE_SUBSCRIPTION_ID}}
AZURE_TENANT_ID: ${{secrets.AZURE_TENANT_ID}}
M365_ACCOUNT_NAME: ${{secrets.M365_ACCOUNT_NAME}}
M365_ACCOUNT_PASSWORD: ${{secrets.M365_ACCOUNT_PASSWORD}}
M365_TENANT_ID: ${{secrets.M365_TENANT_ID}}
steps:
# Provision resources.
- uses: OfficeDev/teamsfx-cli-action@v1
with:
commands: provision
subscription: ${{env.AZURE_SUBSCRIPTION_ID}}
# Deploy the code.
- uses: OfficeDev/teamsfx-cli-action@v1
with:
commands: deploy
# Publish the Teams App.
- uses: OfficeDev/teamsfx-cli-action@v1
with:
commands: publish
您错过了 teamsfx-cli
。见 docs:
"devDependencies": { "@microsoft/teamsfx-cli": "^0.3.1" }
安装完成后,命令 npx teamsfx
就可以使用了。
就工作流程的更改而言,您可能希望首先检查项目,然后 运行 npm ci
。