Use of npm wallpaper in RMMV project

Hello, I'm working on a meta game, and generally experimenting with various features I've seen in similar games. I am trying to change the user's desktop background to an image from the game's folder, using script, after an interaction with the said event. I installed npm wallpaer in my project, and copied and pasted the code from here to an event (using the script option), but everytime the player interacts with the event, I just get en error of "unexpected token {"
Any idea why is this happening?
I'm not extremely familiar with js and its use in RMMV :/

Original thread: https://forums.rpgmakerweb.com/threads/use-of-npm-wallpaper-in-rmmv-project.149885/