豚吐露@wiki

環境構築

最終更新:

Bot(ページ名リンク)

- view
管理者のみ編集可

環境構築

NodeJS on nodenv

nodenvを使って任意のnodeJSを有効にする。
nodenvは、anyenvを使ってinstallする。
nodenv versions
* system
  18.17.1

nodenv global 18.17.1
node --version
v18.17.1

NestJS install

Nest CLIをinstallする。
$ npm install -g @nestjs/cli

install終わったらversionを確認できるか試す。
$ nest --version
10.1.17

NestJS Application作成


$ nest new nest-app
? We will scaffold your app in a few seconds..

? Which package manager would you ?? to use? (Use arrow keys)
? npm
  yarn
  pnpm
package managerの選択。矢印キーで"?"が動くので、選択して...Enterで決定。
個人的にいろんなんpackage managerを混在させるの嫌いなので行けるところまでnpmで...
? Which package manager would you ?? to use? npm
CREATE nest-app/.eslintrc.js (663 bytes)
CREATE nest-app/.prettierrc (51 bytes)
CREATE nest-app/README.md (3340 bytes)
CREATE nest-app/nest-cli.json (171 bytes)
CREATE nest-app/package.json (1949 bytes)
CREATE nest-app/tsconfig.build.json (97 bytes)
CREATE nest-app/tsconfig.json (546 bytes)
CREATE nest-app/src/app.controller.spec.ts (617 bytes)
CREATE nest-app/src/app.controller.ts (274 bytes)
CREATE nest-app/src/app.module.ts (249 bytes)
CREATE nest-app/src/app.service.ts (142 bytes)
CREATE nest-app/src/main.ts (208 bytes)
CREATE nest-app/test/app.e2e-spec.ts (630 bytes)
CREATE nest-app/test/jest-e2e.json (183 bytes)

? Installation in progress... ?

? Successfully created project nest-app
? Get started with the following commands:

$ cd nest-app
$ npm run start


                          Thanks for installing Nest ?
                 Please consider donating to our open collective
                        to help us maintain this package.


               ? Donate: https://opencollective.com/nest

Applicationの動作確認

生成されたNest Applicationを動かしてみる。
$ cd nest-app
$ npm run start

nest-app@0.0.1 start
> nest start

[Nest] 16937 - 09/10/2023, 1:58:09 PM LOG [NestFactory] Starting Nest application...
[Nest] 16937 - 09/10/2023, 1:58:09 PM LOG [InstanceLoader] AppModule dependencies initialized +9ms
[Nest] 16937 - 09/10/2023, 1:58:09 PM LOG [RoutesResolver] AppController {/}: +8ms
[Nest] 16937 - 09/10/2023, 1:58:09 PM LOG [RouterExplorer] Mapped {/, GET} route +2ms
[Nest] 16937 - 09/10/2023, 1:58:09 PM LOG [NestApplication] Nest application successfully started +2ms

nodenv local

一応、local環境にも設定。
$ nodenv local 18.17.1

構成管理

生成されたApplicationはgit initされた状態なので、commitくらいはしておく。
$ git add .
$ git commit -m "base commit"




更新日: 2023年10月14日 (土) 23時39分34秒

名前:
コメント:

すべてのコメントを見る
記事メニュー
ウィキ募集バナー