Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

296
Visualizações
Jest 'SyntaxError: missing ) after argument list' when following ES Module guide from docs

Following jest's official docs to enable ES Modules here: https://jestjs.io/docs/ecmascript-modules

I've followed step 1 by inserting the following config into package.json:

  "jest": {
    "transform": {}
  },

And then running the command they list in step 2

yarn node --experimental-vm-modules $(yarn bin jest)

Results in the following output/exception:

warning package.json: No license field
yarn node v1.22.5
warning package.json: No license field
C:\Users\david\source\repos\algo-ds\node_modules\.bin\jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1033:15)
    at Module._compile (node:internal/modules/cjs/loader:1069:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47
error Command failed.
Exit code: 1
Command: C:\Program Files\nodejs\node.exe
Arguments: --experimental-vm-modules C:\Users\david\source\repos\algo-ds\node_modules\.bin\jest
Directory: C:\Users\david\source\repos\algo-ds
Output:

info Visit https://yarnpkg.com/en/docs/cli/node for documentation about this command.

package.json

{
  "type": "module",
  "jest": {
    "transform": {}
  },
  "dependencies": {
    "@types/jest": "^28.1.3"
  },
  "devDependencies": {
    "jest": "^28.1.1"
  },
  "scripts": {
    "test": "jest"
  }
}

Using Node.js v16.15.1

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda