azure-search-openai-demo
azure-search-openai-demo copied to clipboard
ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: '/tmp/azd-prepackage-304620603.sh'. : exit code: 1
When typing azd up, and after choosing the right subscription and US-west I get
10 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities | ===| Packaging service backend
[email protected] build tsc && vite build
| ===| Packaging service backendfile:///root/azure-search-openai-demo/app/frontend/node_modules/vite/bin/vite.js:7 await import('source-map-support').then((r) => r.default.install()) ^^^^^
SyntaxError: Unexpected reserved word at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18) at async link (internal/modules/esm/module_job.js:42:21) (x) Failed: Packaging service backend
ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: '/tmp/azd-prepackage-304620603.sh'. : exit code: 1
Im getting the same issue when choosing locatio with 'azd up' command. I can set the other env variables up to the 'choose location' command without issue. Is it possible for someone to create an env file template that everyone can substitute to work for their requirments?
You also need to choose target location, the regions that currently support the models used in this sample are East US or South Central US.
Can you run pwsh.exe in Powershell? I couldn't and this fixed it.
I have the exact same problem, but I tried to select East US aswell as South Central US.
My setup is: Ubuntu 22.04 (latest) server-only nodejs installed npm installed python 3.10 installed python3-pip installed
Using azd auth login --use-device-code for login. azd init -t azure-search-openai-demo ran successfully azd up runs into the error, described above:
up to date, audited 122 packages in 736ms
10 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
|====== | Packaging service backend
> [email protected] build
> tsc && vite build
|===== | Packaging service backendfile:///home/chatgpt/app/frontend/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)
(x) Failed: Packaging service backend
ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: '/tmp/azd-prepackage-2524731270.sh'. : exit code: 1
I found the solution for my problem:
My nodejs was not up-to-date, I was running it on 12.X. After upgrading to 18.X i now can proceed in the installation. The requirement is at least 14.18.0, if I'm correct.
had the same issue,
My operating system is windows.
Had to upgrade my powershell: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3#installing-the-msi-package
I have installed node.js 18.16 and powershell 7.3 also selected the location as East US as suggested above but still getting the below error.
error: Cannot find module '.\typescript\bin\tsc' at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) at Module._load (node:internal/modules/cjs/loader:920:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
Node.js v18.16.0 (x) Failed: Packaging service backend
ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: '.\Temp\azd-prepackage-3804030346.ps1'. : exit code: 1
Already tried uninstalling and reinstalling node.js multiple times. Any solution would be really helpful.
I have installed node.js 18.16 and powershell 7.3 also selected the location as East US as suggested above but still getting the below error.
error: Cannot find module '.\typescript\bin\tsc' at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) at Module._load (node:internal/modules/cjs/loader:920:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
Node.js v18.16.0 (x) Failed: Packaging service backend
ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: '.\Temp\azd-prepackage-3804030346.ps1'. : exit code: 1
Already tried uninstalling and reinstalling node.js multiple times. Any solution would be really helpful.
yeah i have also followed every steps but the same error im facing. have you found any ways to run this?
If you're unable to use the local environment for some reason, another possibility is to use GitHub Codespaces. This repo works pretty well in Codespaces, everything will be installed for you.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.
I got this to work by running my command in PowerShell instead of a CMD prompt. Also, it wasn't just normal PowerShell; I had to install an older version of it: PowerShell 7 from https://github.com/powershell/powershell. After installing, I ensured I could run pwsh.exe from a PowerShell terminal.