我在运行脚本时遇到此错误。不知道为什么会这样。好像Evernote的Thrift中可能存在错误
TypeError: Cannot read property 'length' of undefined
at Buffer.write (buffer.js:733:13)
at Object.BinaryParser.fromString (/Users/sam/Documents/evernote/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:502:12)
at BinaryProtocol.writeString (/Users/sam/Documents/evernote/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:148:30)
at BinaryProtocol.writeType (/Users/sam/Documents/evernote/node_modules/evernote/lib/thrift/protocol/binaryProtocol.js:168:25)
at new Thrift.List.write (/Users/sam/Documents/evernote/node_modules/evernote/lib/thrift/thrift.js:275:20)
at new Thrift.Struct.write (/Users/sam/Documents/evernote/node_modules/evernote/lib/thrift/thrift.js:530:17)
at Thrift.Struct.write (/Users/sam/Documents/evernote/node_modules/evernote/lib/thrift/thrift.js:530:17)
at Thrift.Method.sendRequest (/Users/sam/Documents/evernote/node_modules/evernote/lib/thrift/thrift.js:162:15)
at NoteStoreClient.updateNote (/Users/sam/Documents/evernote/node_modules/evernote/lib/thrift/gen-js2/NoteStore.js:1700:8)
at /Users/sam/Documents/evernote/node_modules/evernote/lib/stores.js:106:14
答案 0 :(得分:0)
NoteStore#updateNote将Note
个对象作为参数。您应该能够通过new Evernote.Note()
对其进行实例化。请注意,如果您不打算更新它,则似乎不必设置title
。