Tag Archives: ipfs-api

【ipfs-api】npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

Reasons for this problem:
I used NPM install –save-dev IPFS-API to download IPFS-API first. When using this command to download, IPFS-API is listed in devDependencies separately. Later, when using NPM install –save IPFS-API to reinstall, one comma is missing in removing devDependencies.

npm ERR! code EJSONPARSE
npm ERR! file D:\contract\ipfs\go-ipfs\ipfs-http-demo\package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token } in JSON at position 749 while parsing near '...version"
npm ERR! JSON.parse     ]
npm ERR! JSON.parse   },
npm ERR! JSON.parse }
npm ERR! JSON.parse '
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2020-08-17T11_01_41_124Z-debug.log

The package. Json figure is as follows:

Just delete the bottom comma.