"Bower. json syntax error" is one of the solutions.
When you use Visual Studio 2015 Update 3 to open-source projects downloaded from other places, if you find the Bower prompt "syntax error in bower. json ".
Check whether the encoding format of the. bowerrc file is ANSI. If not, use Notepad ++ and other text editor tools to convert the encoding format.
The procedure is as follows:
I pulled a project with Web from Github and opened it in Visual Studio 2015 Update 3. I found the Bower prompt "bower. json syntax error ".
Following this error message, it is assumed that the bower. json file under the Web Project has a syntax error.
I opened the file, copied the file content, and found a json online verification (www.bejson.com) on the Internet. No syntax error was found.
As a result, I tried to back up bower. json (PS: Actually rename it ).
Then, compare the backup file and use Bower to re-install the dependency.
When I installed jquery, Bower reported an error:
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\Bower.cmd" install jquery#2.2.0 --force-latest --saveC:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower-config\lib\util\rc.js:71 throw error; ^Error: Unable to parse D:\source\xxx\src\xxx.Web\.bowerrc: Unexpected token at parse (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower-config\lib\util\rc.js:64:21) at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower-config\lib\util\rc.js:97:20 at Array.forEach (native) at json (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower-config\lib\util\rc.js:89:14) at rc (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower-config\lib\util\rc.js:34:13) at Config.load (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower-config\lib\Config.js:16:20) at readCachedConfig (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower\lib\config.js:15:39) at defaultConfig (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower\lib\config.js:11:12) at Object.<anonymous> (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\bower\lib\index.js:16:32) at Module._compile (module.js:397:26)
Follow the prompt, FQ Google search a bit, in this http://stackoverflow.com/questions/24534974/emalformed-failed-to-read-bower-json-unexpected-token to find the answer, the general meaning is that the file encoding format is incorrect, converted to the ANSI encoding format is solved.