Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Error: (nodo: 17060) Advertencia: para cargar un módulo ES, configure "tipo": "módulo" en el paquete.json o use la extensión .mjs

Empecé a aprender JavaScript usando Atom para crear un gráfico en línea. Por lo tanto, no estoy muy familiarizado con NPM, package.json y todo ese tipo de cosas.

Quiero importar dos módulos usando el siguiente código:

 import * as am4core from "@amcharts/amcharts4/core"; import * as am4charts from "@amcharts/amcharts4/charts";

Lo que da el siguiente mensaje de error:

 (node:17060) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. (Use `node --trace-warnings ...` to show where the warning was created) C:\Users\PF1VMKH9_ADM\Documents\herverkaveling\test:4 import * as am4core from "@amcharts/amcharts4/core"; ^^^^^^ SyntaxError: Cannot use import statement outside a module at wrapSafe (internal/modules/cjs/loader.js:1001:16) at Module._compile (internal/modules/cjs/loader.js:1049:27) at Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Object.newLoader [as .js] (C:\Users\PF1VMKH9_ADM\.atom\packages\script\node_modules\pirates\lib\index.js:104:7) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at Object.<anonymous> (C:\Users\PF1VMKH9_ADM\.atom\packages\script\node_modules\@babel\node\lib\_babel-node.js:176:21) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) [Finished in 0.522s]

Agregué "type": "module" al archivo package.json pero no resolvió el problema:

 { "name": "packages", "version": "1.0.0", "description": "", "main": "index.js", "type":"module", "dependencies": { "typescript": "^4.4.4" }, "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC" }

¿Qué estoy haciendo mal?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!