我有一本看起来像这样的字典:
[
{
link: '/listing/vasita-otomobil-audi-sahibinden-tertemiz-a3-sedan-849052103/detail',
timestamp: 2020-09-02T16:26:41.007Z
},
{
link: '/listing/vasita-otomobil-opel-mennan-autodan-opel-vectra-hatasiz-2008-lpgli-temiz-bakimli-856921177/detail',
timestamp: 2020-09-02T16:26:41.007Z
},
{
link: '/listing/vasita-otomobil-opel-2012-model-opel-corsa-1.3-cdti-essentia-75-ps-856923040/detail',
timestamp: 2020-09-02T16:26:41.007Z
},
{
link: '/listing/vasita-otomobil-fiat-kirca-otomotiv-2005-fiat-panda-cam-tavanli-otomatik-vites-856922600/detail',
timestamp: 2020-09-02T16:26:41.007Z
},..]
我希望能够将其保存为 json 文件。我这样做:
fs.writeFile('links.json', fs.write(JSON.stringify(pendingLinks)));
它给出了这个错误:
TypeError [ERR_INVALID_ARG_TYPE]: The "fd" argument must be of type number. Received type string ('"[object Object],[object...)