streetmerchant: Test Notification Error
Description
When I run the “npm run test:notification” command I get this error and not receive any notifications:
TypeError: Cannot read property ‘logLevel’ of undefined at Object.<anonymous> (c:\nvidia-snatcher\build\logger.js:22:28) at Module._compile (internal/modules/cjs/loader.js:1085:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:791:14) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (c:\nvidia-snatcher\build\config.js:10:16) at Module._compile (internal/modules/cjs/loader.js:1085:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! nvidia-snatcher@1.5.0 test:notification:
npm run build && node build/__test__/notification-test.jsnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the nvidia-snatcher@1.5.0 test:notification script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Filip\AppData\Roaming\npm-cache_logs\2020-10-07T04_42_51_481Z-debug.log
Debug Log:
0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli ‘C:\Program Files\nodejs\node.exe’, 1 verbose cli ‘C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js’, 1 verbose cli ‘run’, 1 verbose cli ‘test:notification’ 1 verbose cli ] 2 info using npm@6.14.8 3 info using node@v14.13.0 4 verbose run-script [ 4 verbose run-script ‘pretest:notification’, 4 verbose run-script ‘test:notification’, 4 verbose run-script ‘posttest:notification’ 4 verbose run-script ] 5 info lifecycle nvidia-snatcher@1.5.0~pretest:notification: nvidia-snatcher@1.5.0 6 info lifecycle nvidia-snatcher@1.5.0~test:notification: nvidia-snatcher@1.5.0 7 verbose lifecycle nvidia-snatcher@1.5.0~test:notification: unsafe-perm in lifecycle true 8 verbose lifecycle nvidia-snatcher@1.5.0~test:notification: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;c:\nvidia-snatcher\node_modules.bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Filip\AppData\Local\Microsoft\WindowsApps;C:\Users\Filip\AppData\Roaming\npm 9 verbose lifecycle nvidia-snatcher@1.5.0~test:notification: CWD: c:\nvidia-snatcher 10 silly lifecycle nvidia-snatcher@1.5.0~test:notification: Args: [ 10 silly lifecycle ‘/d /s /c’, 10 silly lifecycle ‘npm run build && node build/test/notification-test.js’ 10 silly lifecycle ] 11 silly lifecycle nvidia-snatcher@1.5.0~test:notification: Returned: code: 1 signal: null 12 info lifecycle nvidia-snatcher@1.5.0~test:notification: Failed to exec test:notification script 13 verbose stack Error: nvidia-snatcher@1.5.0 test:notification:
npm run build && node build/__test__/notification-test.js13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:314:20) 13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:314:20) 13 verbose stack at maybeClose (internal/child_process.js:1047:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) 14 verbose pkgid nvidia-snatcher@1.5.0 15 verbose cwd c:\nvidia-snatcher 16 verbose Windows_NT 10.0.19041 17 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “test:notification” 18 verbose node v14.13.0 19 verbose npm v6.14.8 20 error code ELIFECYCLE 21 error errno 1 22 error nvidia-snatcher@1.5.0 test:notification:npm run build && node build/__test__/notification-test.js22 error Exit status 1 23 error Failed at the nvidia-snatcher@1.5.0 test:notification script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (4 by maintainers)
Commits related to this issue
- Update notification.ts Fix for https://github.com/jef/nvidia-snatcher/issues/468 — committed to fsckin/nvidia-snatcher by fsckin 4 years ago
Take these two imports in Notification.ts
And swap them :
Then rebuild and run. This seems to be a circular dependency issue between config and logger. Importing logger before importing config (and thus sendDesktopNotification before playSound) fixes the error.
this means to change order of the lines, line with sendDesktopNotification should be before line containing playSound
to rebuild use nom install command, it worked for me with a rebuild but am no expert to say that is right
If you are still having issues. After you swap the two lines of code… fix your permissions with sudo chown -R $USERNAME /home/$USERNAME
Worked