Azure/static-web-apps-cli

Invalide Node version requirement for static-web-apps-cli 2.0.0

olibos opened this issue · 1 comments

Describe the bug
When running swa deploy command, the cli crash with the following error:

node_modules/@azure/static-web-apps-cli/dist/cli/index.js:22
import pkg from "../../package.json" with { type: "json" };
                                     ^^^^
 
SyntaxError: Unexpected token 'with'
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:152:18)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:298:14)
 
Node.js v18.19.0

If I'm looking at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
image
with {type: 'json'} requires node 20.10.0
and release notes of the cli has the following breaking change :
| Node 18 or later is now required

To Reproduce
Steps to reproduce the behavior:

  1. nvm use v18.19.0
  2. Type in command 'swa deploy dist -env test'
  3. See error

Expected behavior
Deploy succeeds

Desktop (please complete the following information):

  • OS: Windows
  • Version 11

Thank you for the report. We tested with 18.20.3 and 20.10.0, so figured we were safe. We'll take a look this afternoon.