This sample only works with the Windows 10 IoT Core Anniversary Update (Build 14393) release with Visual Studio 2015 and does not currently work with any newer Windows releases or Visual Studio 2017. We are looking into adding Node.js support to UWP in a future release of Windows 10 IoT Core.
Start Visual Studio 2017 and create a new project (File | New Project…). In the
New Project dialog, navigate to
Select the template
Basic Node.js Express 4 Application (Windows Universal)
When the new project is created, you will see the dialog shown below asking if you want to use npm to install Express and its dependencies to the location of the project. Click Yes.
After clicking yes, npm will run in the background and install the dependencies. Once that is complete, your project should look like the picture shown below.
--debugargument is required for debugging and is added automatically).
--use-loggeras an argument to redirect console output to a file in the local storage folder of the UWP application (C:\Data\Users\DefaultAccount\AppData\Local\Packages\<Your Project Name>_<Publisher Hash String>\LocalState\nodeuwp.log).
If you’re building for Minnowboard Max, select
x86 in the dropdown. If you’re building for Raspberry Pi 2 or 3, select
Now we’re ready to deploy to the remote Windows IoT Core device. Simply press F5 (or select Debug | Start Debugging) to start debugging the server.
When the server is running, open up a browser and enter the address http://<IP address of your device>:3000. The result should look like the picture below.