Esta dando esse erro na importação
Erro: node:internal/errors:464 ErrorCaptureStackTrace(err); ^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".tmp" for c:\Users\david\Documents\David\JavaScript\JsOrientacaoObjetos\node_cd313b2bef427.tmp at new NodeError (node:internal/errors:371:5) at Object.file: (node:internal/modules/esm/get_format:72:15) at defaultGetFormat (node:internal/modules/esm/get_format:85:38) at defaultLoad (node:internal/modules/esm/load:13:42) at ESMLoader.load (node:internal/modules/esm/loader:303:26) at ESMLoader.moduleProvider (node:internal/modules/esm/loader:230:58) at new ModuleJob (node:internal/modules/esm/module_job:63:26) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:244:11) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:281:24) { code: 'ERR_UNKNOWN_FILE_EXTENSION' }
index.js
import {Cliente} from "./Cliente.js"
import {ContaCorrente} from "./ContaCorrente.js"
const cliente1 = new Cliente("Ricardo", 11122233309);
const cliente2 = new Cliente("Alice", 88822233309);
const contaCorrenteRicardo = new ContaCorrente(1001, cliente1);
contaCorrenteRicardo.depositar(500);
contaCorrenteRicardo.sacar(100);
const conta2 = new ContaCorrente(102, cliente2);
let valor = 200;
contaCorrenteRicardo.tranferir(valor, conta2);
console.log(contaCorrenteRicardo);
ContaCorrente.js
import {Cliente} from "./Cliente.js"
import {ContaCorrente} from "./ContaCorrente.js"
const cliente1 = new Cliente("Ricardo", 11122233309);
const cliente2 = new Cliente("Alice", 88822233309);
const contaCorrenteRicardo = new ContaCorrente(1001, cliente1);
contaCorrenteRicardo.depositar(500);
contaCorrenteRicardo.sacar(100);
const conta2 = new ContaCorrente(102, cliente2);
let valor = 200;
contaCorrenteRicardo.tranferir(valor, conta2);
console.log(contaCorrenteRicardo);
Cliente.js
export class Cliente{
nome;
_cpf;
get cpf(){
return this._cpf;
}
constructor(nome, cpf){
this.nome = nome;
this._cpf = cpf;
}
}
package.json
{
"name": "bytebank",
"version": "1.0.0",
"description": "Projeto do bytebank para seus clientes",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"type": "module"
}