You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PS C:\Users\Jonathan\WebstormProjects\pew> npm run migrate
> migrate
> ts-node src/index.ts
(node:32716) 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\Jonathan\WebstormProjects\pew\src\index.ts:1
import { drizzle } from 'drizzle-orm/postgres-js';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1153:20)
at Module._compile (node:internal/modules/cjs/loader:1205:27)
at Module.m._compile (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Object.require.extensions.<computed> [as .ts] (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Function.Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at phase4 (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\bin.ts:649:14)
The text was updated successfully, but these errors were encountered:
PS C:\Users\Jonathan\WebstormProjects\pew> npm run migrate
> migrate
> ts-node src/index.ts
C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
src/index.ts:12:1 - error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
12 await migrate(db, { migrationsFolder: "drizzle" });
~~~~~
at createTSError (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859:12)
at reportTSError (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:863:19)
at getOutput (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1077:36)
at Object.compile (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1433:41)
at Module.m._compile (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1617:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Object.require.extensions.<computed> [as .ts] (C:\Users\Jonathan\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Function.Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) {
diagnosticCodes: [ 1378 ]
}
Command
npm run migrate
produces the following error below.The migrate code is located in src/index.ts.
Some more instructions are here: https://orm.drizzle.team/docs/migrations#run-the-migrations
The text was updated successfully, but these errors were encountered: