在执行文档代码时 https://developers.google.com/sheets/quickstart/nodejs?fbclid=IwAR0KmCnMNwsPkzuB93pB8YKaWot7IkAtxWqgLANR1Z08kuRKSl-r3DbqMrY#step_3_set_up_the_sample ,然后输入网址密钥(用于验证的Google帐户)
此错误出现:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="123">the first div</div>
<div id="456">div the second</div>
<div context="james">I'm 'Enry the Eighth, I Am!</div>
答案 0 :(得分:1)
这是由于对NodeJS fs模块进行了更新。只需添加一个空函数作为第三个参数:
fs.writeFile(TOKEN_PATH, JSON.stringify(token), function(){});
或使用ES6语法:
fs.writeFile(TOKEN_PATH, JSON.stringify(token), () => {});
有关更多详细信息,请参见此帖子:Why node 10 has made it mandatory to pass callback on fs.writeFile()?