SyntaxError: Unexpected token M (when running cordova project from Visual Studio 2015)

后端 未结 2 1605
暗喜
暗喜 2021-01-05 17:20

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

2条回答
  •  臣服心动
    2021-01-05 18:12

    The solution is

    and a more permanent fix for this issue (which worked for me):

    1. Is to delete your plugins folder

    2. 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.

提交回复
热议问题