Skip to content

Unable to run /starters/rest-api-typeorm project #8

Description

@Arul-

Followed step by step instructions in https://plumier.js.org/quick-start

npx degit plumier/starters/rest-api-typeorm todo-api
cd todo-api
cp .env-example .env
npm install

This resulted in the following error

> cloned plumier/starters#HEAD to todo-api
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: typeorm@0.3.17
npm ERR! Found: ts-node@9.1.1
npm ERR! node_modules/ts-node
npm ERR!   ts-node@"^9.0.0" from ts-node-dev@1.1.8
npm ERR!   node_modules/ts-node-dev
npm ERR!     dev ts-node-dev@"^1.1.8" from the root project
npm ERR!   peerOptional ts-node@">=9.0.0" from jest-config@27.5.1
npm ERR!   node_modules/jest-config
npm ERR!     jest-config@"^27.5.1" from @jest/core@27.5.1
npm ERR!     node_modules/@jest/core
npm ERR!       @jest/core@"^27.5.1" from jest@27.5.1
npm ERR!       node_modules/jest
npm ERR!         dev jest@"^27.2.4" from the root project
npm ERR!         2 more (@plumier/testing, ts-jest)
npm ERR!       1 more (jest-cli)
npm ERR!     jest-config@"^27.5.1" from jest-cli@27.5.1
npm ERR!     node_modules/jest-cli
npm ERR!       jest-cli@"^27.5.1" from jest@27.5.1
npm ERR!       node_modules/jest
npm ERR!         dev jest@"^27.2.4" from the root project
npm ERR!         2 more (@plumier/testing, ts-jest)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional ts-node@"^10.7.0" from typeorm@0.3.17
npm ERR! node_modules/typeorm
npm ERR!   peer typeorm@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: ts-node@10.9.1
npm ERR! node_modules/ts-node
npm ERR!   peerOptional ts-node@"^10.7.0" from typeorm@0.3.17
npm ERR!   node_modules/typeorm
npm ERR!     peer typeorm@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/arul/.npm/_logs/2023-07-12T07_33_34_103Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/arul/.npm/_logs/2023-07-12T07_33_34_103Z-debug-0.log

Fixed the above error with the following

npm --force install
npm i --save-dev ts-node-dev@latest

After this, I get the following when I run debug

npm run debug

> rest-api-typeorm@1.0.0 debug
> ts-node-dev --inspect -- src/index

[INFO] 13:14:57 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 4.9.5)
Debugger listening on ws://127.0.0.1:9229/8db908f9-24f3-4226-8394-8902a2251045
For help, see: https://nodejs.org/en/docs/inspector
Compilation error in /Users/arul/Projects/temp/todo-api/src/api/auth/auth-controller.ts
Error: No TypeORM entity found, check your connection configuration
    at TypeORMFacility.preInitialize (/Users/arul/Projects/temp/todo-api/node_modules/@plumier/typeorm/lib/facility.js:101:19)
    at Plumier.initialize (/Users/arul/Projects/temp/todo-api/node_modules/plumier/lib/application.js:52:17)

How to fix this and proceed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions