出现这个问题的原因:

    本人是先使用npm install --save-dev ipfs-api下载的ipfs-api,使用该命令下载时,ipfs-api会单独放在devDependencies中,后来使用npm install --save ipfs-api重新安装的时,在删除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

package.json图如下: 

 

删除最下边的那个逗号即可。

更多推荐

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