以下のような関数を挿入したいのですが,
js
1function exe(box){ 2 const XlsxPopulate = require('xlsx-populate') 3 XlsxPopulate.fromFileAsync("./r-rec.xls").then((book) => { 4 const sheet1 = book.sheet("Sheet1") 5 sheet1.cell("A4").value(100) 6 sheet1.cell("A5").value(200) 7 sheet1.cell("A6").value(300) 8 book.toFileAsync("./r-rec.xls") 9 }) 10 let a = box.num ; 11 console.log("exeから :" + a) ; 12 }
の部分で,
node:15772) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'children' of null
at Object.findChild (/Users/motegiyuta/node_modules/xlsx-populate/lib/xmlq.js:44:28)
at StyleSheet._init (/Users/motegiyuta/node_modules/xlsx-populate/lib/StyleSheet.js:203:34)
at new StyleSheet (/Users/motegiyuta/node_modules/xlsx-populate/lib/StyleSheet.js:59:14)
at externals.Promise.resolve.then.then.then.then.then.nodes (/Users/motegiyuta/node_modules/xlsx-populate/lib/Wor
kbook.js:612:36)
at <anonymous>
(node:15772) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing
inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (re
jection id: 1)
(node:15772) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise reject
ions that are not handled will terminate the Node.js process with a non-zero exit code.
のようなエラーが出てしまいます.
プロミスは使っていないのですが,よろしくお願いいたします
回答1件
あなたの回答
tips
プレビュー