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

On Macbook: 'prepackage' hook failed with exit code: '127' #20

Open
SINHAPIYUSH opened this issue Jul 12, 2023 · 2 comments
Open

On Macbook: 'prepackage' hook failed with exit code: '127' #20

SINHAPIYUSH opened this issue Jul 12, 2023 · 2 comments

Comments

@SINHAPIYUSH
Copy link

Please provide us with the following information:

After making the changes as mentioned in the git repo readme when I run the following command the Macbook
azd up

I am getting the below error:

Executing prepackage hook => /var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-prepackage-3025571478.ps1
/var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-prepackage-3025571478.ps1: pwsh: command not found

ERROR: failed running pre hooks: 'prepackage' hook failed with exit code: '127', Path: '/var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-prepackage-3025571478.ps1'. : exit code: 127

This issue is for a: (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

azd up on MacBook VSCode

Any log messages given by the failure

Executing prepackage hook => /var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-prepackage-3025571478.ps1
/var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-prepackage-3025571478.ps1: pwsh: command not found

ERROR: failed running pre hooks: 'prepackage' hook failed with exit code: '127', Path: '/var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-prepackage-3025571478.ps1'. : exit code: 127

Expected/desired behavior

It should deploy the repo

OS and Version?

MacOS M2 chip

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

@SINHAPIYUSH
Copy link
Author

SINHAPIYUSH commented Jul 12, 2023

After resolving this issue by installing
brew install --cask powershell

Facing this issue below:

Executing preprovision hook => /var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-preprovision-2787934008.ps1
Connect-AzAccount: /var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-preprovision-2787934008.ps1:4:31
Line |
4 | Install-Module AzureAD -Force;Connect-AzAccount;$principalId = (Get-A …
| ~~~~~~~~~~~~~~~~~
| The term 'Connect-AzAccount' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was
| included, verify that the path is correct and try again.

ERROR: failed running pre hooks: 'preprovision' hook failed with exit code: '1', Path: '/var/folders/t1/6k5yrx055dnf88pf4b12v6f40000gp/T/azd-preprovision-2787934008.ps1'. : exit code: 1

@SINHAPIYUSH SINHAPIYUSH reopened this Jul 12, 2023
@pgr-lopes
Copy link

pgr-lopes commented Aug 20, 2023

Hi. I'm getting the same problem using git bash on Windows. Did you ever get an answer to this? I get the same 'pwsh' is not recognized.

edit: The problem was with the PowerShell module. I re-downloaded powershell and it's working now.

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

2 participants