删除json文件之后提示文件不存在
PS F:\china_regions-3.3> node main.js
2020-09-09T11:07:58+0800 main.js:51 (newRequestPromise) request == > http://219.235.129.117:80/tjsj/tjbz/tjyqhdmhcxhfdm/2018/
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at pullVillageDataSync (F:\china_regions-3.3\main.js:391:25)
at Object. (F:\china_regions-3.3\main.js:422:1)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
PS F:\china_regions-3.3> node main.js
2020-09-09T11:08:42+0800 main.js:51 (newRequestPromise) request == > http://219.235.129.117:80/tjsj/tjbz/tjyqhdmhcxhfdm/2018/
然后我在文件夹里加上了town.json
F:\china_regions-3.3\main.js:393
jsonData.slice(offset).forEach(function(element, index) {
^
TypeError: jsonData.slice is not a function
at pullVillageDataSync (F:\china_regions-3.3\main.js:393:14)
at Object. (F:\china_regions-3.3\main.js:422:1)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
PS F:\china_regions-3.3>