A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
Windows 10 setup (including VS Code debugging)
-
I have an Intel Compute Stick which runs Windows 10 that I am planning to use for my mirror. Getting Magic Mirror running was really easy as the manual steps outlined in the README.md file are mostly cross-platform.
But I wanted to create modules and debug them using VS Code. There are a couple hurdles there.
- You can launch Magic Mirror using VS Code. You will have to create a launch.json file as outlined here. Make sure to read the comments as they are helpful. I will put my final file in a reply to this.
- You may run into an exception:
TypeError: Cannot read property 'name' of undefined
inMagicMirror\modules\default\updatenotification\node_helper.js:35:43
. The root cause of this is someError: spawn git ENOENT
messages that you may see further up in the log. I think this is an effort to check GitHub for updates…anyways it seems to do something with git and this error means it can’t find git in your path. (Basically if you opened a command prompt and typed git it would tell you that it is an unrecognized command.) Install Git from git-scm.com and that should solve it (must restart VS Code though). The installer has an option about the Windows path–choose to add Git to the path. I had GitHub Desktop installed and it apparently uses its own portable version of Git which it doesn’t add to the path.
These should get you a good running setup. Debugging works for the main code base but doesn’t seem to work for modules. That is next on my list.
-
My launch.json file:
{ // Use IntelliSense to learn about possible Node.js debug attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "node", "request": "launch", "program": "${workspaceRoot}\\js\\electron.js", "stopOnEntry": false, "args": [], "cwd": "${workspaceRoot}", "runtimeExecutable": "${workspaceRoot}\\node_modules\\.bin\\electron", "runtimeArgs": [ ".", "--enable-logging" ], "env": {}, "console": "integratedTerminal", "sourceMaps": false, "outDir": null }, { "name": "Attach", "type": "node", "request": "attach", "port": 5858, "sourceMaps": false, "outDir": null } ] }
-
do you know who it works with visual studio 2015?
-
@aaronaxvig If you enable it to working. You can be add into a step in project for help to other users.
-
@aaronaxvig To run MagicMirror automatically on startup:
- Create a .bat file and put it in the startup folder (Windows Explorer > type “shell:startup” without quotes in the address bar).
- Set the contents of the bat file:
cd your MagicMirror Git repository folder
npm start