Skip to content

[Installment Support Request] Deployment fails with import statement syntax error on Windows 10 #17

@wu1ah3y

Description

@wu1ah3y

Hi devs,

Thanks for this great project, and I am trying to deploy the project on my PC, following the instruction in readme file. However, there's something wrong when running the backend server.
And here's the environment versions:

  • OS: Windows 10
  • Node.js: v20.16.0
  • npm: v10.8.1
    I followed the setup instructions in the README by running npm install, configure the .env file and then npm run dev in the backend directory. But there's a SyntaxError occurred, here's the bash console log below:
D:\1\nodejsProject>git clone https://github.com/baturyilmaz/wordpecker-app.git
Cloning into 'wordpecker-app'...
remote: Enumerating objects: 474, done.
remote: Counting objects: 100% (118/118), done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 474 (delta 73), reused 48 (delta 48), pack-reused 356 (from 1)
Receiving objects: 100% (474/474), 4.50 MiB | 11.43 MiB/s, done.
Resolving deltas: 100% (161/161), done.

D:\1\nodejsProject>cd wordpecker-app

D:\1\nodejsProject\wordpecker-app>cd backend

D:\1\nodejsProject\wordpecker-app\backend>npm install
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 593 packages in 14s

87 packages are looking for funding
  run `npm fund` for details

D:\1\nodejsProject\wordpecker-app\backend>npm run dev

> language-learning-backend@1.0.0 dev
> nodemon src/app.ts

[nodemon] 3.1.9
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts,json
[nodemon] starting `ts-node src/app.ts`
D:\1\nodejsProject\wordpecker-app\backend\node_modules\@openai\agents\dist\index.js:1
import { setDefaultModelProvider } from '@openai/agents-core';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (node:internal/modules/cjs/loader:1281:20)
    at Module._compile (node:internal/modules/cjs/loader:1321:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Object.require.extensions.<computed> [as .js] (D:\1\nodejsProject\wordpecker-app\backend\node_modules\ts-node\src\index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (D:\1\nodejsProject\wordpecker-app\backend\src\agents\definition-agent\index.ts:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
[nodemon] app crashed - waiting for file changes before starting...

And I expected there may be some environment problem caused by node version, so I check gemini and try some method such as switch mode to ES module, modify dev script for enabling .ts file, modify tsconfig module to ESnext, however which always tends to causing further problems and eventually guide me to modifying function definitions in source code.

Therefore, I don't think I can handle this issue on my own, and thank you for looking into this. Any guidance would be greatly appreciated. I'm happy to provide any additional information you need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions