belann 0 Denunciar post Postado Dezembro 2, 2023 Olá! Estou com problemas ao executar esse código. (node:12372) 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\ar\ntask-api\index.js:1 import express from 'express'; ^^^^^^ SyntaxError: Cannot use import statement outside a module at internalCompileFunction (node:internal/vm:77:18) at wrapSafe (node:internal/modules/cjs/loader:1288:20) at Module._compile (node:internal/modules/cjs/loader:1340:27) at loader (C:\Users\ar\ntask-api\node_modules\babel-register\lib\node.js:144:5) at Object.require.extensions.<computed> [as .js] (C:\Users\ar\ntask-api\node_modules\babel-register\lib\node.js:154:7) at Module.load (node:internal/modules/cjs/loader:1207:32) at Function.Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at Object.<anonymous> (C:\Users\ar\ntask-api\node_modules\babel-cli\lib\_babel-node.js:154:22) at Module._compile (node:internal/modules/cjs/loader:1376:14) Node.js v21.2.0 Compartilhar este post Link para o post Compartilhar em outros sites