0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Nestjsの依存関係で詰まった話

Posted at

nestJSで職場でもプライベートでも詰まる

職場で詰まった原因と解決策

  • サービス層に@Injectable() デコレーターをつけ忘れていたこと
  • importがサービスの型のみでサービスがimportされていないため
    • vscodeの自動追加で気づけなかった

ex)
×import { xxxService } from './xxx.service';
〇import { xxxService } from './xxx.service';

プライベートで詰まった原因

Nest can't resolve dependencies of the TypeOrmCoreModule

  • プロジェクトディレクトリではnpmを使っており、具体的なnestjsプロジェクト部分ではpnpmを使っており、うまくインストールできていなかったため

project/task

project:npm
task:pnpm

taskをカレントディレクトリにしてpnpm install --save @nestjs/typeorm typeorm pg を行いなおすことで解決

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?