-
Notifications
You must be signed in to change notification settings - Fork 475
Description
`C:\Users\hp\learn-fullstack-javascript>babel-node server.js
(node:16052) 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\hp\learn-fullstack-javascript\server.js:1
import config, { nodeEnv, logStars } from '/config';
^^^^^^
SyntaxError: Cannot use import statement outside a module
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 loader (C:\Users\hp\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions. [as .js] (C:\Users\hp\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-register\lib\node.js:154:7)
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 Object. (C:\Users\hp\AppData\Roaming\npm\node_modules\babel-cli\lib_babel-node.js:154:22)
at Module._compile (node:internal/modules/cjs/loader:1105:14)`