Puts up this error when i run node serveronly in magicmirror folder
Closed this issue · 8 comments
any ideas why this might be doing this? thanks!
WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/modules/MMM-OnThisDay/EventService.js:18
_html = '';
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_helper.js:10:22)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
Are you using a fresh install of this module? Did you follow the install instructions? What module configuration and which NodeJS version are you using? Thanks.
yes it is fresh, i followed the instructions exactly, ill do an update and ill do it again just to make sure, node v10.23.0, here is my configuration
{
disabled: false,
module: 'MMM-OnThisDay', // npm install --only=prod
position: "top_left", // All available positions
config: {
// See below for configurable options, this is optional
}
},
i did another fresh install and ran npm test it gave this error also
npm test
MMM-OnThisDay@0.1.1 test /home/pi/MagicMirror/modules/MMM-OnThisDay
nyc mocha test/unit --recursive
sh: 1: nyc: not found
npm ERR! Test failed. See above for more details.
actually saw someone had this issue on a different module of yours
nkl-kst/MMM-RBB-Weather#12, ill try the steps see if that works for me
i had to run the install nyc globally as sudo but it installed ran the test again and this came up, almost reproduced the same error as baschke but on a different module
pi@raspberrypi:~/MagicMirror/modules/MMM-OnThisDay $ npm test
MMM-OnThisDay@0.1.1 test /home/pi/MagicMirror/modules/MMM-OnThisDay
nyc mocha test/unit --recursive
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn mocha ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! Test failed. See above for more details.
ok getting warmer lol, i saw that you said to try all dependancies so i did a normal npm install and this showed up now when i ran npm test, what do you think? not sure where to go from here tbh ill check over and see if there's anything i notice but im still new to coding, i know some CSS and html but havent touched js really much yet
pi@raspberrypi:~/MagicMirror/modules/MMM-OnThisDay $ npm test
MMM-OnThisDay@0.1.1 test /home/pi/MagicMirror/modules/MMM-OnThisDay
nyc mocha test/unit --recursive
/home/pi/MagicMirror/modules/MMM-OnThisDay/EventService.js:11
/_html=(cov_1eohv4gwf6().s[1]++,'');_resolve=(cov_1eohv4gwf6().s[2]++,null);_reject=(cov_1eohv4gwf6().s[3]++,null);/
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Module.replacementCompile (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/append-transform/index.js:60:13)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object..js (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/append-transform/index.js:64:4)
at require.extensions.(anonymous function) (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/proxyquire/lib/proxyquire.js:311:43)
at Object. (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/append-transform/index.js:64:4)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at Proxyquire._withoutCache (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/proxyquire/lib/proxyquire.js:222:12)
at Proxyquire.load (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/proxyquire/lib/proxyquire.js:129:15)
at Object. (/home/pi/MagicMirror/modules/MMM-OnThisDay/test/unit/EventServiceTest.js:28:22)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module.replacementCompile (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/append-transform/index.js:60:13)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object. (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/append-transform/index.js:64:4)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.exports.requireOrImport (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/mocha/lib/esm-utils.js:20:12)
at Object.exports.loadFilesAsync (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/mocha/lib/esm-utils.js:33:34)
at Mocha.loadFilesAsync (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/mocha/lib/mocha.js:431:19)
at singleRun (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/mocha/lib/cli/run-helpers.js:125:15)
at exports.runMocha (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/mocha/lib/cli/run-helpers.js:190:10)
at Object.exports.handler (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/mocha/lib/cli/run.js:362:11)
at innerArgv.then.argv (/home/pi/MagicMirror/modules/MMM-OnThisDay/node_modules/yargs/lib/command.js:241:49)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
-------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
...rvice.js | 0 | 100 | 0 | 0 | 8-75
...isDay.js | 0 | 0 | 0 | 0 | 8-159
...elper.js | 0 | 0 | 0 | 0 | 8-61
-------------|---------|----------|---------|---------|-------------------
npm ERR! Test failed. See above for more details.
I think you solved your problem, because of the other issue and pr you opened recently? Feel free to reopen this one if I am wrong.
nope this isnt solved, this is the error, not sure what it means but it comes up when you run it in serveronly which im sure isnt good lol was just letting you know it came up is all, im not sure if its even an issue or effects the running of things