That’s because require isn’t part of JavaScript. It’s part of node.js to load modules. There are potentially other ways of doing what you’re trying to do. You may want to check out this post on Stack Overflow.
Read the statement by Michael Teeuw here.
Posts
-
RE: readFileSync
-
RE: Current weather appid
Just shear curiosity, can you remove the comments and see if that makes any difference? Basically trim it down to just:
{ module: 'currentweather', position: 'top_right', config: { location: 'Amsterdam,Netherlands', appid: 'YOUR_ID_HERE' } },Not that I can think of any reason why it would fail, but I have had issues with stuff placed in odd places in the config file and causing it to fail.
-
RE: Developers running Windows 10.
Yeah, I saw that too when using Edge. I need to spent some time looking into that, but I’m also working on other code … one thing at a time. :)
-
RE: Config Help!
Also, you are not required to enter all of those weather parameters unless you are actually changing them. Bare minimum all you need is your location and your API ID. The iconTable, apiBase, Version, all of those things are already defined for you. Only if you want to change the defaults do you have to define them.
-
RE: Config Help!
You’re missing commas between your feed definitions.
feeds: [ { title: "..." url: "..." }, // <--- you're missing commas there } title: "..." url: "..." } ] -
RE: Calendar does not appear
Can you check the console output, see if it’s throwing an error?
-
RE: FontAwesome icons..
We do use FontAwesome with the Calendar module. Take a look at how that’s implemented (how to include the font-awesome.css file, and how to allow the user to pick which symbol to use.)

-
RE: PIR-Sensor - put your mirror to sleep if not used
This is more of a PSA than anything else, but particularly since the tvservice is part of the rPi’s firmware. While running
'sudo apt-get update && sudo apt-get upgrade'will upgrade your rPi’s packages and firmware, it may not be the latest version. For most, this is okay. But if you’re like me, who likes to live on the bleeding edge of things, particularly when something isn’t working right, running'sudo rpi-update'separately will update the firmware only, including binaries such as'tvservice'since they’re part of the firmware, not just a standard package (in fact, you can’t find it as a stand alone package through'apt-cache'.)Use at your own risk. :)
-
RE: Speech recognition available?
Not as a current module. But there are others who have added speech recognition to their rPis. Do a Google search for
'raspberry pi speech recognition'… -
RE: Face Recognition with inferred light
And yes, I suppose simply
'purge'would get the job done, but there are times I only want to remove the binaries, but leave my config files in place. I prefer forcing myself to actually add the'--purge'bit each time … sort of a mental check.