NestJS v9 -> v10
The project was created with NestJS v9 and now it can be upgraded to v10. To achieve this using ncu, we should follow these steps:
Install the latest node LTS version through nvm and activate it
Install yarn (if you use it) and nest globally
Install ncu globally
Inside the project directory, use ncu to check available updates
Update everything
Change the eslint in package.json back to v8, due to many breaking changes
Then, we should update the .gitignore file, by putting at the end of the #compiled output section:
And after the # IDE - VSCode section:
In the tsconfig.json file, alter the target field to ES2021.
Finally, delete yarn.lock and node_modules, and run yarn to actually update the dependencies.
If you are on Windows and want to switch the line break of your files back from LF to CRLF, you may perform the following steps:
In the file .prettierrc, set
endOfLine
to "crlf"In the terminal, run the following commands
yarn format
git config core.autocrlf true
Set
endOfLine
back to "auto"
Commit - Upgrading from NestJS v9 to v10
Last updated