Closed ArfyFR closed 3 years ago
Full log nest log.txt
@ArfyFR try removing the @types/jest
(they are for the jest 25, project starter uses jest 26) and import the jest methods in tests
import { afterEach, beforeEach, describe, it } from "@jest/globals";
So
@types/jest
from package.jsonnpm i
againnest build
Lots of errors. More than 2500.
Next I deleted all, and tried from beginning:
nest new project-name
⚡ We will scaffold your app in a few seconds..
CREATE project-name/.eslintrc.js (663 bytes)
CREATE project-name/.prettierrc (51 bytes)
CREATE project-name/nest-cli.json (64 bytes)
CREATE project-name/package.json (1894 bytes)
CREATE project-name/README.md (3370 bytes)
CREATE project-name/tsconfig.build.json (97 bytes)
CREATE project-name/tsconfig.json (339 bytes)
CREATE project-name/src/app.controller.spec.ts (617 bytes)
CREATE project-name/src/app.controller.ts (274 bytes)
CREATE project-name/src/app.module.ts (249 bytes)
CREATE project-name/src/app.service.ts (142 bytes)
CREATE project-name/src/main.ts (208 bytes)
CREATE project-name/test/app.e2e-spec.ts (630 bytes)
CREATE project-name/test/jest-e2e.json (183 bytes)
? Which package manager would you ❤️ to use? npm
√ Installation in progress... ☕
� Successfully created project project-name
� Get started with the following commands:
$ cd project-name
$ 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
What next ?
Remove the @types/jest
in ?
Then ?
I found a way to make the "nest new" work on Windows 10
I did what was told here: https://stackoverflow.com/questions/56266800/nestjs-errors-stemming-from-types-dependencies-in-node-modules-when-running-sta
By adding this line to tsconfig.json
:
"typeRoots": ["./node_modules/@types"],
@ArfyFR Thanks! Can confirm this works on Ubuntu 20.10. For context, I was trying to install Nest alongside Angular in the same repo. Tried to combine the package.json, node_modules, and tsconfig files just for the sake of efficiency but it will not work as they may require different versions of TypeScript and other dependencies, so I installed in a server
subdirectory. Kept getting these errors but that typeRoots
setting did the trick; I think Nest was picking up Jasmine typings from the parent directory where Angular is at.
Bug Report
I wanted to try Nest
Current behavior
I did what is written in the doc:
Same with git version, I mean
And after the
npm run start,
I gotExpected behavior
Run the test/demo project
Possible Solution
Environment