So, I'm playing around with this new framework http://nestjs.com/ who seems pretty awesome since it allows the usage of Typescript on Node, very likely to angular.
Using the starter https://github.com/kamilmysliwiec/nest-typescript-starter, I can run it with npm run start
without any problem, but since there is a .vscode on the project, I assumed I could use VS Code to run and gain some debug abilities.
The problem is that when I run directly from VS Code, without changing anything in the code, I get the following problem:
Error: Cannot find module 'nest.js'
I tried to run from VS Code with and without it running from NPM, no success.
Thanks in advance.
Then, navigate to the debug pane in the VSCode activity bar by clicking on the icon or by using the keyboard shortcut ( ctrl+shift+D/cmd+shift+D ). Finally, select the Debug NestJS Framework configuration from the dropdown and run the debugger by pressing the start icon or using the keyboard shortcut (F5).
Open the settings in VS Code (CMD + , on Mac or CTRL + , on Windows). You can also go to the Command Palette (CMD + P on Mac or CTRL + P on Windows) and search for settings. Search for “auto attach” and you'll see a setting for Node: Auto Attach. Go ahead and turn that on.
To create a launch.json file, click the create a launch.json file link in the Run start view. If you go back to the File Explorer view (Ctrl+Shift+E), you'll see that VS Code has created a .vscode folder and added the launch.json file to your workspace.
I updated nest-typescript-starter
today. The previous version had an old dist
directory, with outdated imported packages. If you want to compile your application, use npm run start:prod
script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With