NestJS 설치 (+에러 해결법)
nestjs로 프로젝트를 시작해볼까해서 설치 시작
터미널에
$ npm i -g @nestjs/cli
로 설치를 했지만
Failed to execute command: node @nestjs/schematics:application --name=nest-app --directory=undefined --no-dry-run --no-skip-git --no-strict --package-manager="npm" --collection="@nestjs/schematics" --language="ts"
이런 에러만 나오더라
검색해보니 kt망에서 다운로드 오류가 있다던가 하는 말도 있고 그에 따른 해결책도 따라해봤지만 잘 되지 않던차에 stackoverflow어딘가에서 8.x.x버전으로 받으라는 말이 있었다.
$ npm uninstall -g @nestjs/cli
로 기존에 설치되어 있던 nestjs를 지우고
$ npm i -g @nestjs/cli@8.0.0
로 재설치 후
$ nest new nest-app
을 실행하니 드디어 성공 메시지가 나온다.
PS C:\dev\nestjs> nest new nest-app
⚡ We will scaffold your app in a few seconds..
CREATE nest-app/.eslintrc.js (665 bytes)
CREATE nest-app/.prettierrc (51 bytes)
CREATE nest-app/nest-cli.json (118 bytes)
CREATE nest-app/package.json (1992 bytes)
CREATE nest-app/README.md (3340 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)
? Which package manager would you ❤️ to use? npm
√ Installation in progress... ☕
$ 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
간단히 개인공부하려고 했는데 첫 실행부터 에러를 맞으니 의욕이 꺾였지만 어찌어찌 해결은 되었다.