cypress-io / cypress-realworld-app

A payment application to demonstrate real-world usage of Cypress testing methods, patterns, and workflows.

Home Page:https://docs.cypress.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript error preventing the application from starting.

naeemakram opened this issue · comments

I've tried multiple times and getting a Typescript error while starting the application. Please see the error below.
image

@naeemakram

  • What is your operating system? Windows x?
  • Which version of Node.js are you using? 20.11.0
  • Which command did you run? yarn dev?
  • Have you modified your clone of the example repo https://github.com/cypress-io/cypress-realworld-app and / or installed any different versions of dependencies?

I am not seeing any errors on Windows 11 with Node.js 20.11.0

git clone https://github.com/cypress-io/cypress-realworld-app
cd cypress-realworld-app
npm install yarn@latest -g
yarn
yarn dev

This is the normal log of yarn dev on Windows 11:

$ yarn dev
yarn run v1.22.19
$ yarn db:seed:dev
$ yarn predev:cognito:ci
$ yarn copy:mock:awsexports && yarn copy:mock:awsexportses5
$ ncp scripts/mock-aws-exports.js src/aws-exports.js
$ ncp scripts/mock-aws-exports-es5.js aws-exports-es5.js
$ ncp ./data/database-seed.json ./data/database.json
$ cross-env NODE_ENV=development concurrently yarn:start:react yarn:start:api:watch
$ nodemon --exec yarn tsnode --watch 'backend' backend/app.ts
$ vite:react]
[start:api:watch] [nodemon] 2.0.22
[start:api:watch] [nodemon] to restart at any time, enter `rs`
[start:api:watch] [nodemon] watching path(s): 'backend'
[start:api:watch] [nodemon] watching extensions: ts,json
[start:api:watch] [nodemon] starting `yarn tsnode backend/app.ts`
$ nyc --silent ts-node -P tsconfig.tsnode.json backend/app.ts
[start:react]
[start:react]   VITE v4.4.2  ready in 3938 ms
[start:react]
[start:react]   ➜  Local:   http://localhost:3000/
[start:react]   ➜  Network: use --host to expose
[start:api:watch] Browserslist: caniuse-lite is outdated. Please run:
[start:api:watch]   npx update-browserslist-db@latest
[start:api:watch]   Why you should do it regularly: https://github.com/browserslist/update-db#readme
[start:api:watch] express-validator: sanitize(), sanitizeBody() and other sanitization-only middlewares have been deprecated.
[start:api:watch] Please use check(), body() and others instead, which must offer the same API, and more.
[start:api:watch] Backend server running at http://localhost:3001

I have the following:
Windows 11
Node 18.13.0
Yar 1.22.22

Yes, I ran Yarn dev command. I cloned the repo from Git.

@naeemakram

You say you are using Node.js 18.13.0. The README says:

This project requires Node.js to be installed on your machine. Refer to the .node-version file for the exact version.

so you should update Node.js to the requested version. I don't know if that will resolve your issue though as I am not able to reproduce it. Good luck!

Closing as stale