azure-search-openai-demo icon indicating copy to clipboard operation
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

Open tekntrash opened this issue 1 year ago • 7 comments

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

tekntrash avatar May 22 '23 08:05 tekntrash

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?

s4096087 avatar May 25 '23 00:05 s4096087

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.

JTYEG avatar May 26 '23 17:05 JTYEG

Can you run pwsh.exe in Powershell? I couldn't and this fixed it.

yoelnono avatar Jun 01 '23 07:06 yoelnono

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

fakoe avatar Jun 01 '23 13:06 fakoe

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.

fakoe avatar Jun 01 '23 14:06 fakoe

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

DireWolfCoder avatar Jun 05 '23 13:06 DireWolfCoder

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.

ApurvaL avatar Jun 09 '23 12:06 ApurvaL

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?

DhavalWI avatar Aug 02 '23 10:08 DhavalWI

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.

pamelafox avatar Aug 02 '23 21:08 pamelafox

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.

github-actions[bot] avatar Dec 24 '23 01:12 github-actions[bot]

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.

brentkendall avatar Jun 06 '24 15:06 brentkendall