![]() ![]() You can run this server from any directory, and it detects changes to your files and reloads the page in the browser, which is really useful. The web server I recommend you install is live-server. Create a file index.html with this content: The system wide path should contain this:Ĭ:\Program Files\nodejs\ Creating your projectĬreate a new directory Demo and open this directory in VS Code. The path for your user should contain this: ![]() There are two Paths, one for your user (at the top of the window) and one systemwide (at the bottom). If you still get an error, make sure npm and nodejs have been added to your path: How to check if something is included in path in Windows Make sure npm, node.js' package manager is added to path. ![]() Install Visual Studio Code and Node.jsįirst download VS Code and Node.js and install both. The first part, installing VS Code and Node.js was also covered in my last tutorial, Getting started with TypeScript in Visual Studio Code, so if you have already done that, skip to section Creating your project below. This is a tutorial of how to start a really small project, containing only a single HTML file in VS Code and edit it with live preview in a browser. When using VS Code, you have to rely on the power of Node.js instead. This can be a bit confusing for those of us used to just hitting F5 in Visual Studio and getting our website launch in a browser. VS Code, being extremely lightweight (at least compared to Visual Studio), does not come with its own web server. ![]()
0 Comments
Leave a Reply. |