When I attempt to run my Cordova app using Visual Studio 2015 using Remote Device, I get an error \"SyntaxError: Unexpected token M\". Visual Studio is installed on windows
and a more permanent fix for this issue (which worked for me):
Is to delete your plugins folder
Restore all of your plugins. (listed in your package.json
in an array called cordovaPlugins
)
Hint: Run cordova plugin ls
to have a list of what you need to add back in.
I use Ionic so I just used this command: ionic state restore --plugins
and voila problem solved for ever (I hope).
PS. FYI don't run cmd as administrator for this, it could be the cause of your issues with iOS apps...
Got to the root of the problem from Navid Harandi's answer.