<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MMM-NOAA V2 doesn&#x27;t start (Unexpected token &lt; in JSON at position 0)]]></title><description><![CDATA[<p dir="auto">Hey guys,</p>
<p dir="auto">last time I did not let myself be seen often ^^<br />
But i never left u at all ;)</p>
<p dir="auto">Now i have a Problem and need your help guys :(</p>
<p dir="auto">I installed a little linux server a few months ago for managing several things. And now its time to install MM in server mode i thought.</p>
<p dir="auto">Lubuntu (Ubuntu 18.04.1 LTS) on x86 Hardware<br />
node v8.10.0<br />
npm v6.3.0<br />
MM v2.4.1</p>
<p dir="auto">What i did:</p>
<ul>
<li>I downloaded all modules i used on my raspberry and installed them like the readme says</li>
<li>I copied my RPi config.js and used it on the linux server</li>
</ul>
<p dir="auto">Most modules are working, but:</p>
<p dir="auto">MMM-NOAA and MMM-RemoteControl are giving errors -.-</p>
<p dir="auto">So I have several issues but lets start with NOAA ^^</p>
<p dir="auto">While doing npm install in the NOAA folder i get this error:</p>
<pre><code>chris@ioBroker:~/MagicMirror/modules/MMM-NOAA$ npm install
npm WARN grunt-stylelint@0.10.0 requires a peer of stylelint@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN stylelint-config-recommended@2.1.0 requires a peer of stylelint@^8.3.0 || ^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN stylelint-config-standard@18.2.0 requires a peer of stylelint@^8.3.0 || ^9.0.0 but none is installed. You must install peer dependencies yourself.

audited 1218 packages in 12.16s
found 1 critical severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

</code></pre>
<pre><code>chris@ioBroker:~/MagicMirror/modules/MMM-NOAA$ npm audit
                                                                                
                       === npm audit security report ===                        
                                                                                
# Run  npm update fill-range --depth 5  to resolve 1 vulnerability
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Cryptographically Weak PRNG                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ randomatic                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint [dev]                                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint &gt; micromatch &gt; braces &gt; expand-range &gt; fill-range  │
│               │ &gt; randomatic                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/157                       │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Critical      │ Sandbox Breakout                                             │
├───────────────┼───���──────────────────────────────────────────────────────────┤
│ Package       │ safe-eval                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ google-translate-api                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ google-translate-api &gt; safe-eval                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/337                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 2 vulnerabilities (1 low, 1 critical) in 1220 scanned packages
  run `npm audit fix` to fix 1 of them.
  1 vulnerability requires manual review. See the full report for details.
</code></pre>
<pre><code>chris@ioBroker:~/MagicMirror/modules/MMM-NOAA$ npm audit fix
npm WARN grunt-stylelint@0.10.0 requires a peer of stylelint@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN stylelint-config-recommended@2.1.0 requires a peer of stylelint@^8.3.0 || ^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN stylelint-config-standard@18.2.0 requires a peer of stylelint@^8.3.0 || ^9.0.0 but none is installed. You must install peer dependencies yourself.

up to date in 5.181s
fixed 0 of 1 vulnerability in 1218 scanned packages
  1 vulnerability required manual review and could not be updated
</code></pre>
<p dir="auto">Anyhow…<br />
When i start MM with “node server only dev” i get this:</p>
<pre><code>chris@ioBroker:~/MagicMirror$ node serveronly dev
Starting MagicMirror: v2.4.1
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: MMM-TelegramBot
Initializing new module helper ...
Module helper loaded: MMM-WatchDog
Initializing new module helper ...
Module helper loaded: MMM-Remote-Control-Repository
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: MMM-Oiltank
No helper found for module: MMM-EasyPix.
Initializing new module helper ...
Module helper loaded: MMM-NOAA
Initializing new module helper ...
Module helper loaded: MMM-MovieListings
Initializing new module helper ...
Module helper loaded: MMM-Tools
No helper found for module: MMM-NowPlayingOnSpotify.
Initializing new module helper ...
Module helper loaded: MMM-CalendarExt
Initializing new module helper ...
Module helper loaded: MMM-MyCommute
All module helpers loaded.
Starting server on port 8080 ... 
You're using a full whitelist configuration to allow for all IPs
Server started ...
Connecting socket for: MMM-TelegramBot
Connecting socket for: MMM-WatchDog
Starting module helper: MMM-WatchDog
Connecting socket for: MMM-Remote-Control-Repository
Connecting socket for: updatenotification
Connecting socket for: MMM-Oiltank
Connecting socket for: MMM-NOAA
Starting module: MMM-NOAA
Connecting socket for: MMM-MovieListings
MMM-MovieListing helper started...
Connecting socket for: MMM-Tools
Connecting socket for: MMM-CalendarExt
Connecting socket for: MMM-MyCommute
====================== Starting node_helper for module [MMM-MyCommute]
Sockets connected &amp; modules started ...

Ready to go! Please point your browser to: http://0.0.0.0:8080
Whoops! There was an uncaught exception...
SyntaxError: Unexpected token &lt; in JSON at position 0
    at JSON.parse (&lt;anonymous&gt;)
    at Request.request [as _callback] (/home/chris/MagicMirror/modules/MMM-NOAA/node_helper.js:77:30)
    at Request.self.callback (/home/chris/MagicMirror/node_modules/request/request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.&lt;anonymous&gt; (/home/chris/MagicMirror/node_modules/request/request.js:1157:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.&lt;anonymous&gt; (/home/chris/MagicMirror/node_modules/request/request.js:1079:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
</code></pre>
<p dir="auto">From now on i can’t figure out whats the problem…<br />
Line 77 in the NOAA node_helper checks the current position and when i type “<a href="http://www.ip-api.com/json" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.ip-api.com/json</a>” in my browser i get a result beginning with:</p>
<pre><code>{"as":"AS3320 Deutsche Telekom AG", etc.....
</code></pre>
<p dir="auto">So why is he saying Position 0 in JSON is a SyntaxError</p>
<p dir="auto">Anyone have an idea?</p>
<p dir="auto">Thank u guys</p>
<p dir="auto">Edit:</p>
<p dir="auto">Oh ehm… here the config snippet:</p>
<pre><code>{
			disabled: false,
			module: 'MMM-NOAA',
			position: 'top_left',
			config: {

				apiKey: "XXX",
				airKey: "XXX",    // IF you want Air Quality Index
				pws: "XXX"       
				}
			},
</code></pre>
<p dir="auto">And yes, i used the new API from weatherbit</p>
]]></description><link>https://forum.magicmirror.builders/topic/8549/mmm-noaa-v2-doesn-t-start-unexpected-token-in-json-at-position-0</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 06:33:19 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/8549.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Aug 2018 15:52:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MMM-NOAA V2 doesn&#x27;t start (Unexpected token &lt; in JSON at position 0) on Fri, 10 Aug 2018 03:34:29 GMT]]></title><description><![CDATA[<p dir="auto">@sean said in <a href="/post/43243">MMM-NOAA V2 doesn't start (Unexpected token &lt; in JSON at position 0)</a>:</p>
<blockquote>
<p dir="auto">request({<br />
url: “<a href="http://ip-api.com/json" target="_blank" rel="noopener noreferrer nofollow ugc">http://ip-api.com/json</a>”,<br />
method: ‘GET’<br />
}, (error, response, body) =&gt; {<br />
console.log(body) // Try logging suspicious point.<br />
info = JSON.parse(body);<br />
lat = info.lat;<br />
lon = info.lon;<br />
});</p>
</blockquote>
<p dir="auto">OMG thank you so much…</p>
<p dir="auto">I am a dumbass XD<br />
My PiHole blocked the <a href="http://ip-api.com" target="_blank" rel="noopener noreferrer nofollow ugc">ip-api.com</a> domain, so i put this to the whitelist and its running.</p>
<p dir="auto">Sorry guys</p>
]]></description><link>https://forum.magicmirror.builders/post/43260</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/43260</guid><dc:creator><![CDATA[cruunnerr]]></dc:creator><pubDate>Fri, 10 Aug 2018 03:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NOAA V2 doesn&#x27;t start (Unexpected token &lt; in JSON at position 0) on Fri, 10 Aug 2018 00:49:14 GMT]]></title><description><![CDATA[<p dir="auto">If you used the new api from weatherbit then you know you don’t need the pws in the config any longer… ;)</p>
]]></description><link>https://forum.magicmirror.builders/post/43255</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/43255</guid><dc:creator><![CDATA[cowboysdude]]></dc:creator><pubDate>Fri, 10 Aug 2018 00:49:14 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NOAA V2 doesn&#x27;t start (Unexpected token &lt; in JSON at position 0) on Thu, 09 Aug 2018 16:27:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cruunnerr" aria-label="Profile: cruunnerr">@<bdi>cruunnerr</bdi></a><br />
I’m not the creator but hope this being a help.</p>
<pre><code class="language-javascript">request({
            url: "http://ip-api.com/json",
            method: 'GET'
        }, (error, response, body) =&gt; {
                 console.log(body) // Try logging suspicious point.
                 info = JSON.parse(body);
                 lat = info.lat;
                 lon = info.lon; 
        });
</code></pre>
<p dir="auto">You can get what’s wrong with this log.</p>
<p dir="auto">Anyway, the codes look to try to get Latitude and Longitude,<br />
You can set it manually like this;</p>
<pre><code>/*
request({
            url: "http://ip-api.com/json",
            method: 'GET'
        }, (error, response, body) =&gt; {
                 info = JSON.parse(body);
                 lat = info.lat;
                 lon = info.lon; 
        });
*/
lat = "50.233"; // You can get your lat &amp; lon from https://www.latlong.net/
lon = "8.266",
</code></pre>
<p dir="auto">And you can define this value in config and modify script with <code>this.config.js</code></p>
]]></description><link>https://forum.magicmirror.builders/post/43243</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/43243</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 09 Aug 2018 16:27:28 GMT</pubDate></item></channel></rss>