Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sh: 1: tsc: permission denied sh: 1: ./node_modules/typescript/bin/tsc: permission denied #260

Open
Janithg-Swivel opened this issue Jan 26, 2025 · 0 comments

Comments

@Janithg-Swivel
Copy link

Hi,

Im deploying a node.js backend using github actions to azure functions flex consumption plan and getting the below error,

`sh: 1: tsc: Permission denied
sh: 1: ./node_modules/typescript/bin/tsc: Permission denied
sh: 1: tsc: Permission denied\nsh: 1: ./node_modules/typescript/bin/tsc: Permission denied\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1 More information: 
Failed during oryx build due to sh: 1: tsc: Permission denied\nsh: 1: ./node_modules/typescript/bin/tsc: Permission denied\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1 More information: 
Deployment failed with Error: sh: 1: tsc: Permission denied\nsh: 1: ./node_modules/typescript/bin/tsc: Permission denied\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20.11.1 More information: 
Error: Failed to deploy web package to Function App.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error:   When request Azure resource at PublishContent, oneDeploy : Failed to use /home/runner/work/_temp/temp_web_package_1[38](https://github.com/xxxxx/actions/runs/12924760318/job/36044365921#step:8:39)4555822604263.zip as OneDeploy content
Error:     Package deployment using ZIP Deploy failed. Refer logs for more details.
Error: Deployment Failed!`

workflow is as below<

name: FlexConsumption test - Manual
on:
workflow_dispatch:

defaults:
run:
shell: bash --noprofile --norc -exo pipefail {0}

env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.'

jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- name: Print the user who triggered the workflow
  run: echo "This workflow was triggered by ${{ github.actor }}"

- name: Code Checkout
  uses: actions/checkout@v3

- name: Node.js Setup
  uses: actions/setup-node@v3
  with:
    node-version: ${{matrix.node-version}}

- name: Clear npm cache
  run: |
    rm -rf node_modules
    npm cache clean --force
    npm un -g typescript
    npm i -g typescript@latest
    
- name: 'Resolve Project Dependencies Using Npm'
  run: |
    pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
    npm install
    npm run build --if-present
    npm run test --if-present
    popd

    
- name: Upload to Azure Functions
  uses: azure/[email protected]
  with:
    app-name: ${{vars.FLEX_APP_NAME}}
    publish-profile: ${{secrets.FLEX_APP_PUBLISH_PROFILE}}
    package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
    remote-build: true
    sku: flexconsumption

tried so many solutions like deleting node modules, granting execution permissions to ./node_modules/typescript/bin/tsc etc, appreciate your support on this and please check the workflow file as well and let me know if we are missing something or going somewhere wrong.

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant