1
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?

More than 1 year has passed since last update.

"Cannot find module '@nestjs/config"への対応

Posted at

発生した事象

Nest.jsからTypeORMを使用したく導入を進めていました。
以下のようにConfigModuleとConfigServiceを使いたくimportしようとしたのですが、
"Cannot find module '@nestjs/config' "というエラーが出ており
importできませんでした。

import { ConfigModule, ConfigService } from '@nestjs/config';

@nestjs/configモジュールがないということなので
node_modulesディレクトリを確認すると、
@nestjs/configモジュールがディレクトリ内に存在していませんでした。

解決方法

@nestjs/configがインストールされていなかったため
以下のコマンドでインストールをしたら解決しました。

npm install @nestjs/config

原因

@nestjs/configがインストールされていなかった原因は分かりませんでした。
nestjsをインストールした際にコマンドや設定で何か漏れていたのかもしれません。

もしわかる方いらっしゃれば教えていただけますと幸いです!

1
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
1
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?